Removing the post navigation block of links

Note: This snippet is not needed anymore, just go through Appearance -> Customize -> Main content -> Post/Page Navigation and set up the navigation block visibility to suit your needs 😉

Hi,

In case you need to get rid of the post navigation block of links at the bottom of a single post, here’s a quick line of code to do it.

 

Where to copy/paste this code? => in your functions.php file. The best way to customize a theme in WordPress is to create a child theme. Everything you need to know about child theme creation in Customizr here

 

add_action ( 'wp_head', 'remove_single_post_nav_links');
function remove_single_post_nav_links() {
	//we only want to remove those nav links for a sinlge post and not for the list of posts
	if ( !is_single() )
		return;
	//this action is defined in the class-content-post_navigation.php file
	remove_action  ( '__after_loop' , array( TC_post_navigation::$instance , 'tc_post_nav' ), 20 );
}

That’it!

I hope this will help and look forward to reading your thoughts and your code if you find other ways to do that.

6 thoughts on “Removing the post navigation block of links”

Comments are closed.