Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.