In single.php, after content code
get_template_part( 'template-parts/post/content', get_post_format() ); // content code
there is the code for post navigation (means links to move between this and that posts)
the_post_navigation(
array(
'prev_text' => '...' . '...',
'next_text' => '...' . '...',
)
);
it shows two links for the previous post and next one of the current post at the bottom of the screen,
however, the problem is when you click/tab the links again and gain, you find the links include any posts from all different categories, just in order of their written date and time.
Here is the way to move among only one category, even though you keep clicking/tabbing the prev/next links.
the_post_navigation(
array(
'prev_text' => '...' . '...',
'next_text' => '...' . '...',
'in_same_term' => true,
'taxonomy' => 'category',
)
);
Yup, adding that two lines are all.
Happy wordpressing!
피드 구독하기:
댓글 (Atom)
Xubuntu: Installing a Printer (Canon G3060 PIXMA)
$ sudo apt install system-config-printer Download the proper driver for linux from Canon website. Turn on the printer and set up its WiFi. C...
-
$ sudo apt install system-config-printer Download the proper driver for linux from Canon website. Turn on the printer and set up its WiFi. C...
-
https://askubuntu.com/questions/1056386/how-do-i-backup-all-gnome-tweaks-configuration From the terminal, execute the following to save y...
-
Put your ' My_Color_Scheme.vim ' file in ~/.vim/colors/ Add the code below into your ~/.vimrc if &term =~ "xterm" ...
댓글 없음:
댓글 쓰기