Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mag_check_post_navigation ( $output, $format, $link, $post ) {
- // if this post is not the current issue then return blank
- if ( !has_term( mag_get_current_issue() , 'issue' , $post) ) return '';
- return $output;
- }
- // add the check to the next and previous post links - make sure 4 parameters are passed so we get $post
- add_filter( 'next_post_link' , 'mag_check_post_navigation', 10, 4);
- add_filter( 'previous_post_link' , 'mag_check_post_navigation', 10, 4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement