Restrict previous & next nav to same category in single.php in 2017 theme
-
Hi,
I’m having problems with the 2017 theme not seeming to resemble normal wordpress themes as I understood them, back in the mists of history when I last tried to customise stuff.
I’ve created a child theme, with a single.php file, and I want to restrict the previous & next nav to just posts in the same category.
The code in the file is:
the_post_navigation( array( 'prev_text' => '<span class="screen-reader-text">' . __( 'Previous Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Previous', 'twentyseventeen' ) . '</span> <span class="nav-title"><span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-left' ) ) . '</span>%title</span>', 'next_text' => '<span class="screen-reader-text">' . __( 'Next Post', 'twentyseventeen' ) . '</span><span aria-hidden="true" class="nav-subtitle">' . __( 'Next', 'twentyseventeen' ) . '</span> <span class="nav-title">%title<span class="nav-title-icon-wrapper">' . twentyseventeen_get_svg( array( 'icon' => 'arrow-right' ) ) . '</span></span>', ) );
But I just flat out don’t understand this, at all.
Would someone please just copy me back a version of this that limits the navigation to the current category? Unless it requires changes to my child theme’s functions.php, then those would be appreciated.
I used to teach wordpress customisation to graphic design students in tertiary education, but that was back in 2010, sadly, I find some of the newer stuff baffling.
Thanks.
- The topic ‘Restrict previous & next nav to same category in single.php in 2017 theme’ is closed to new replies.