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...
-
Supported by Ine Hordvik In order to set the sync client language to English, t ry the following: Open your control panel Go to System ...
-
1) 공인 인증서(범용, 은행/보험용) 파일 저장 위치 - Windows XP/Vista C:\Program Files\NPKI - Windows 7(64bit) C:\Users\[사용자 아이디]\AppData\L...
-
One of the very best Windows Tip ever! Control Panel -> Region and Language -> Additional Settings button -> Date tab -> ...
댓글 없음:
댓글 쓰기