Skip to content

Instantly share code, notes, and snippets.

@Nikschavan
Created June 4, 2018 13:21
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nikschavan/eeb9010ed684a3ca17047bd4a49079c3 to your computer and use it in GitHub Desktop.
Save Nikschavan/eeb9010ed684a3ca17047bd4a49079c3 to your computer and use it in GitHub Desktop.
Astra - Disable Next/Previous post navigation for specific post type
<?php // don't copy this line in your code.
/**
* Disable Next/Previous post links on specific post ttype.
* Change `your-post-type` to your post-type slug.
*
* @param Boolean $status true - If the navigation is displayed. False - If navigation is disabled.
* @return Boolean $status true - If the navigation is displayed. False - If navigation is disabled.
*/
function your_prefix_next_prev_links( $status ) {
if ( 'your-post-type-slug' == get_post_type() ) {
$status = false;
}
return $status;
}
add_filter( 'astra_single_post_navigation_enabled', 'your_prefix_next_prev_links' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment