Archived topic
nav-links not displaying in Archive
14 replies · Started by Mohit on September 19, 2018
Hi,
Nav links for archives (numbers below post archive that shows how many posts are there) stopped displaying. They were displaying before but no longer are displaying?
Hi there,
have you added any plugins since that has happened? Can you try disabling any plugins one by one and see if it resolves the issue
Hi,
No I didn't added any plugin.
Have you added any functions to a child theme or GP Hooks?
Yes I did added breadcrumb in hook.
Here is my website link check it out: http://www.techtechnik.com/
i wouldn't expect that to effect the nav, it shouldn't, but can you remove the hook and see if it makes any difference.
I disabled the hook but no luck
How many posts per page do you have set in "Settings > Reading"? It looks like you only have 7 posts?
Hi Tom,
I have more than 200 posts but can’t see the nav link neither in homepage nor in archive!
Hey Tom,
Guess I found out why they are not displaying, refer to this thread: https://generatepress.com/forums/topic/next-previous-navigation-button-style/
the code that you suggested me to hide post nav is also hiding post nav on archives and homepage.
Is it possible to review the code and let me know to hide and style it only on single blog posts!
Thanks
Aha, so instead of this:
add_filter( 'generate_show_post_navigation', '__return_false' );
Do this:
add_action( 'wp', function() {
if ( is_single() ) {
add_filter( 'generate_show_post_navigation', '__return_false' );
}
} );
Hey,
It didn't hide the post navigation! Instead, I am getting two post navigations.
See it here: https://prnt.sc/kwilty
Try replacing after_setup_theme with wp.
It worked,
Thanks
You're welcome :)