Comments on: Get next post and previous post by meta key https://pluginrepublic.com/get-next-post-previous-post-meta-key/ WooCommerce Plugins Fri, 29 Jun 2018 18:55:53 +0000 hourly 1 By: Jonathan https://pluginrepublic.com/get-next-post-previous-post-meta-key/#comment-9882 Fri, 29 Jun 2018 18:55:53 +0000 https://pluginrepublic.com/?p=4458#comment-9882 Great article, you really helped me out with this one!
One little correction for pf_get_adjacent_exhibition_link( $previous ):
rel should be “next” or “prev”, not always “prev, like this:

$string = sprintf(
‘%s’,
$class,
get_permalink( $prev_id ),
$previous ? “prev” : “next”,
get_the_title( $prev_id )
);

]]>
By: Dave https://pluginrepublic.com/get-next-post-previous-post-meta-key/#comment-5263 Wed, 20 Dec 2017 16:25:56 +0000 https://pluginrepublic.com/?p=4458#comment-5263 Awesome read, thanks very much! This article helped me a lot in achiving what i set out to do and is clear and well explained. I have two suggestions or comments:

– in the “pf_update_exhibition_transient” function i had to remove the 2nd and 3rd argument in the function call, otherwise creating a new post would throw errors in the backend

– in the “pf_get_adjacent_exhibition_link” function i changed “if( $exhibs[$new_pos] )” to “if( isset($array[$new_pos]))” to avoid getting a out of bounds

cheers,
Dave

]]>