Not sure if this is what you want, gets all the categories and outputs a link to the next and previous in the order returned from get_categories()
:
$this_category = get_queried_object();
$categories = get_categories();
foreach( $categories as $position => $cat ) :
if( $this_category->term_id == $cat->term_id ) :
$next_cat = $position + 1;
$prev_cat = $position - 1;
break;
endif;
endforeach;
$next_cat = $next_cat == count($categories) ? 0 : $next_cat;
$prev_cat = $prev_cat < 0 ? count($categories) - 1 : $prev_cat;
echo 'previous: ' . get_term_link( $categories[$prev_cat] );
echo 'next: ' . get_term_link( $categories[$next_cat] );
Related Posts:
- Get the children of the parent category
- wp_nav_menu not appearing for a couple pages
- Main menu not appearing on category pages
- Previous/next link to post in category, NOT tag?
- Multiple menu items highlighted
- wp_nav_menu not highlighting the current category when viewing a single post
- Open subcategories in submenu on click in primary menu
- How to display only posts assigned to a particular, isolated, subcategory
- Checkboxes in the category list?
- Restoring default article pagination on archives – Removing custom limits
- previous/next_post_link in the same sub-category?
- Create menu / submenu from category subcategory and posts
- How to display numbered pages in a category
- Give Children Unique ID’s
- Multiple categories for one menu item?
- Global navigation in multisite: problem with categories
- display specific category when website loads
- How to add all subcategories as submenu in WordPress menu
- Next and previous links category infinite loop
- omit categories from main navigation menu
- Loop within category’s posts
- Grouping parent categories into sections
- A simple question regarding tags and categories
- get_adjacent_post_link excluded_terms ignored
- Transfering static site to wordpress and retaining category by month paginations
- Post in multiple categories do not include in previous / next post if one category in excluded
- Get all first images of posts in same category
- In category.php I need to get the next 10/previous 10 posts
- How to check if I’m on the last page of posts?
- Where/how are categories stored?
- Get top parent category
- wp_update_nav_menu_item() to insert categories
- Redirecting specific category posts to subdomain
- How can I prevent users from creating new categories?
- Get child categories when clicking on parent category
- Block multiple categories from Blog
- Best and Cleanest way to remove /category/ from category permalinks? [duplicate]
- Categories list loop – add separator every year
- Category List With Comma & Link
- Login “Lightbox” for specific category content
- Duplicate Category and Page URL loads Category instead of the Page
- Change the_content() in Theme Thirteen
- WordPress subcategories return 404 in custom template
- how to show the post category name
- Find out which user created a category or tag?
- Search in custom post type AND in pages with category
- Mod_Rewrite to show only last subcategory in URL
- wp_dropdown_categories() scripts working erratically on sidebar
- How to exclude the last post from a category(featured for example) from the main loop?
- Category RSS feed doesn’t show category name
- menu using category and tags
- Have parent category contain only one post?
- wp e-commerce group product by category [closed]
- Limit get_categories to show each category once
- get parent category only
- How to get parent category ID in single page template
- “Item not updated” when try to change category properties
- How can I tell what category I’m in– in the header?
- new WP_Query all post in a category inside the loop
- How to display sticky or latest published post on the current category page it belongs to?
- How do I add a separator to my list of terms with get_category
- Category tags with comma’s
- Trying to create a Categorised Index (archive?) to use as my Home Page
- Filter posts by categories ajax is showing nothing
- How to display child categories of all parent category within a singe loop?
- How can I add a class to displays a category?
- How to show only the name of one category above each posts in frontpage?
- WP_Query – using category__and when one of the categories is 0
- Hide categories from frontend, but not admin / post editor
- Exclude categories from homepage not longer working
- Post to inherit custom category background image from parent
- Related posts widget – category
- Editing Loop So It Targets Specific Tags?
- Check boxes for showing categories
- Header Link function not working. Problem with bloginfo()
- WordPress category filters as subcategories
- Sort posts alphabetically by category/custom taxonomy, insert divider between different types
- Is there a “sensible” limit to WordPress Categories?
- Display Category Name and Date Posted on Blog Post
- Modifying category order
- How to remove “Categories:” part after the post title? [closed]
- Please tell how to stop the category from showing up on posts
- Editing categories crashes WordPress site
- Remove “category” from permalink with add_rewrite_rule
- Conditional Site Logo(Category Based)
- show only terms from parent category
- Accessible Subcategory URL’s pages without using .php hack
- How to display total views of all posts of one category?
- in_category(‘category-sluga’) returns true for Archive page of Category ‘category-slugb’
- wp_list_category only showing to logged in uers
- How to show “category” name?
- Querying Multiple Categories With Different Offsets
- filter single_cat_title avoiding the breadcrumbs
- htaccess redirect for all categories converted to tags now showing 404
- Category page with gallery for each post
- (WordPress) How to get custom taxonomy parent name?
- Search functionality with multiple categories
- Make a menu visible for a single category and it’s content
- How to define category ID in an array?
- How to add custom prefix before category base for category page URL?