Since I’m not sure if you are using single.php for anything else, I am going to suggest that you copy single.php to single-14kgs.php in the theme directory.
Once you have done that, modify the following:
<?php next_posts_link(); ?>
becomes…
<?php next_post_link('%link','%title',TRUE) ?>
and
<?php previous_posts_link(); ?>
becomes…
<?php previous_post_link('%link', '%title', TRUE); ?>
The third argument to those functions tells WP to generate a link and stay in the same category.
For further reading:
https://codex.wordpress.org/Function_Reference/previous_post_link
https://codex.wordpress.org/Function_Reference/next_post_link
Related Posts:
- Display posts from the same category using next/previous post link
- How can I create a category landing page followed by pages of posts?
- How can I hide a category from Contributors in the edit/add new post screen?
- WordPress Multiple Category Search
- Display all posts from all categories with pagination
- Multiple Domain Names – One WP Install (non-Multisite) – Default Each Domain name to Category Archive
- how to use a different domain/subdomain for authors/catagories on single site?
- Delete a specific category when deleting a user
- How to list child categories in custom category template?
- Show Previous/Next Posts navigation only inside the same category
- Trash bin for categories
- View category in the preview of Theme Customizer
- One WordPress Install, Two Categories. Each Category Gets a Domain
- Block multiple categories from Blog
- Create single.php for specific category by category id
- Select category in custom query
- Custom category template pagination problem
- Force category-slug.php to show page, even if it doesn’t exist
- Apply custom category template to subcategories
- Hide post meta data on a specific category
- Format Brand value in Category view [closed]
- Add custom taxonomy under the category title
- How to show in search results posts with a particular tag in a particular category?
- What is the advantage of using header-catname.php over is_category(‘catname’);?
- Remove ‘rel’ attributes from the_category() output
- Multiple menu items highlighted
- in_category() works in single.php but not in page.php?
- Use a wordpress page to display a certain category
- Multiple Category Search
- How do I add a function on a specific post category?
- 3 Columns, 3 Categories, One Archive, and Pagination
- ?cat=-1 Indexed Versions Of Homepage
- How to customize category template?
- Category-slug.php not being used
- How would I go about adding custom header images per category?
- Pagination for category slug returns 404 when page >= 2
- Automatically exclude categories from metabox based on title
- Pagination is not working properly in Product Category/Tag pages
- Restoring default article pagination on archives – Removing custom limits
- How to categorize posts under Category 1 and Category 2 which are separate lists of categories, and display them as separate lists in widgets
- Why category.php throw 404 in wordpress while calling paginate_links()?
- Paging not working in category.php
- Multiple Loops on category.php with pagination on last loop
- How to rewrite the post URL according to the category?
- Category archives with monthly pagination
- Pagination for ajax category filter
- Display thumbnails for certain category posts
- Keyword search in multiple categories
- Is it possible to remove from default category widget?
- WordPress alphabetical A-Z custom post type post result display
- How to show 1-5 of X Total Results
- How to do paging in the loop?
- Multiple selection for wordpress widget
- Different CSS class by category
- how to nest specific category thumbnails inside different containers
- Wrong category nice name is displayed on archive page
- Remove any product that is featured from regular display loop [WooCommerce]
- Two Sections on Woocommerce Catergory Page [closed]
- Theme for subcategories
- Pagination doesn’t work on multiple categories
- Custom css per category and per single post belong in each category
- custom query for both category and pages using global $wpdb;
- I would like to feature a tip on the homepage
- SQL query to get posts from multiple categories but not in a category
- Pagination breaks on child-categories, works fine on parent-category
- Pagination for a category
- wp_delete_term or wp_delete_category?
- Select posts that match multiple category names, must match all categories listed
- Conditional category query breaking?
- Last x Posted Categories?
- Category pagination not working
- show only sub categories if available?
- How do I remove pagination from just some Categories?
- Pagination for custom categories template
- Unable to create pagination for Category.php
- problem with filter of custom portfolio categories
- Deleted categories still listed until additional page refresh
- Category custom template is not showing correct posts
- Search Replace Database ONLY for posts of certain category?
- Filter custom taxonomy posts via AJAX
- “Next posts” of a category do not call category.php
- Need help to structure our a complex hierarchy
- Show posts from all categories
- Paginations in Category Page Leads to Sample Pages
- How do you add Author and date Published on Category Pages?
- If it is a top level category show children otherwise show sibling categories
- Transfering static site to wordpress and retaining category by month paginations
- WordPress Numeric Pagination with Query String [duplicate]
- date.php shows all posts. how to fix it?
- display certain category on custom template page
- Paginating a list of all posts collected by category titles
- Paginate WordPress Category Pages
- why is the delete option missing from just one category?
- Can i know if it is Category first page or 5th?
- How to prevent page re-sizing for mobile browsers [closed]
- Exclude posts from certain category breaks custom pagination
- i want to add pagination list of categories
- Woocommerce custom taxonomy order
- Link to page in category
- wordpress category rewrite rule with pagination