How to disable the post navigation that links to the next/previous post on single entries?
I did check the box in Enfold\ Blog Layout\ Disable the post navigation, but the navigation is still there.
Hey tennetno,
Please add following code to Functions.php file in Appearance > Editor
function no_post_nav($entries)
{
$entries = array();
return $entries;
}
add_filter('avia_post_nav_entries','no_post_nav');
Best regards,
Jordan Shannon
As this is one of the top Google search results for how to remove the Enfold Post Navigation / Previous / Next Buttons:
You should use this code with more recent versions of Enfold instead to prevent PHP Warnings:
/* Remove Post navigation */
function custom_disable_avia_post_nav( $settings ) {
$settings['skip_output'] = true;
return $settings;
}
add_filter( 'avf_post_nav_settings', 'custom_disable_avia_post_nav', 10, 1 );
Hey,
Thanks for sharing, Jan!
We have added it to our docs as well – https://kriesi.at/documentation/enfold/blog-post/#remove-post-navigation :)
Best regards,
Yigit
@yigit: You are welcome! You should also update the code example for “Remove Post Navigation for a post type” in your docs.
/* Remove Post navigation for CPT */
function custom_disable_avia_post_nav_for_cpt( $settings ) {
if ( is_singular( 'portfolio' )) {
$settings['skip_output'] = true;
}
return $settings;
}
add_filter( 'avf_post_nav_settings', 'custom_disable_avia_post_nav_for_cpt', 10, 1 );