Title: Only posts in specific category browsing?
Last modified: August 18, 2016

---

# Only posts in specific category browsing?

 *  [tinarawatta](https://wordpress.org/support/users/tinarawatta/)
 * (@tinarawatta)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/only-posts-in-specific-category-browsing/)
 * I wonder if it is possible to browse the pictures in a specific category only.
   
   For Example: I have category “heaven” and there are 5 pictures (posts) in it.
   If a user goes to archive then all categories will be listed (I know how to do
   that!). If he clicks the “heaven” he will see the 5 pictures as thumbnails (I
   also know how to do that) listed in that category. If he clicks on one of the
   picture he gets the picture like it was postet. Now he should be able to browse
   back and forward, but only in these 5 pictures in the category “heaven”. Will
   this be possible? And if yes how can i do that? I hope you understand what I 
   mean and want to do. Thank you very much, lg Christina

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/only-posts-in-specific-category-browsing/#post-236951)
 * WP normally should work like that out of the box.
 *  Thread Starter [tinarawatta](https://wordpress.org/support/users/tinarawatta/)
 * (@tinarawatta)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/only-posts-in-specific-category-browsing/#post-236953)
 * I donÂ´t think so, because if I click on a post and use the next/previous links,
   it goes to the next post on cronolocical order, not in the category….
    For example:
   day 1: post in category 1 day 2: post in category 2 day 3: post in category 1-
   > go to archives->category “1”->post day 3…..clicking on previous will take me
   to day2 post in category 2 not to the previous post in category1 (day 1). I hope
   it it a little bit more clear what I want to do. Thanks Christina
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/only-posts-in-specific-category-browsing/#post-236956)
 * Oops, sorry. With single posts it doesn’t work. There were plugins for it in 
   pre-1.5 versions, but they don’t work anymore.
 *  Thread Starter [tinarawatta](https://wordpress.org/support/users/tinarawatta/)
 * (@tinarawatta)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/only-posts-in-specific-category-browsing/#post-237100)
 * Is there a possiblility to change the code, so that this will work?
    If yes where
   and how? thanks Christina
 *  [Lorelle](https://wordpress.org/support/users/lorelle/)
 * (@lorelle)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/only-posts-in-specific-category-browsing/#post-237122)
 * Well, not really. There was/is/maybe a `in_same_cat` parameter you could use 
   but it works and doesn’t work.
 * See: [http://codex.wordpress.org/Good_Navigation_Links](http://codex.wordpress.org/Good_Navigation_Links)
   
   [http://codex.wordpress.org/Next_and_Previous_Links](http://codex.wordpress.org/Next_and_Previous_Links)
 * I have also been using two other plugins to force this to work, but they require
   familiarity with PHP and template tags and template files. Are you up for this?
 * [http://www.meyerweb.com/eric/tools/wp/mw_next_prev.html](http://www.meyerweb.com/eric/tools/wp/mw_next_prev.html)–
   works great but the original code there “was” borked. It’s an easy fix but I 
   can’t find my notes on how to fix it. So here is the pastebin of the plugin that
   WORKS so you can use it. [http://pastebin.com/317115](http://pastebin.com/317115)
 * [http://www.scriptygoddess.com/archives/2004/07/24/nextprevious-posts-in-same-category/](http://www.scriptygoddess.com/archives/2004/07/24/nextprevious-posts-in-same-category/)
   but this also requires some fussing and hasn’t been updated, though it should
   be.
 * You can see these two at work in the sidebar of my site. Click on my name here
   and then on any post. It only shows when viewing single posts not on mutliple
   post pages.
 * Like I said, these only sorta work. It’s something that should be fixed up in
   the next release.
 *  Thread Starter [tinarawatta](https://wordpress.org/support/users/tinarawatta/)
 * (@tinarawatta)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/only-posts-in-specific-category-browsing/#post-237138)
    - [http://codex.wordpress.org/Template_Tags/next_post](http://codex.wordpress.org/Template_Tags/next_post)
    - tells, that the in_same_cat is working again in 1.5.1.3.
       But where to put
      the ‘yes’ or ‘no’?
    - `previous_post_index('&laquo; % | ','','yes');
       next_post_index('% &raquo;
      | ','','yes');
    - this is how teh code looks like now.
       << title_prvious_picture | title_next_picture
      >> is how it looks like in the header. And if in_same_cat works, what if i
      have all posts in one category “view all” and in a second category that is
      different… Will it then also work? Thanks for help, lg Christina
 *  Thread Starter [tinarawatta](https://wordpress.org/support/users/tinarawatta/)
 * (@tinarawatta)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/only-posts-in-specific-category-browsing/#post-237492)
 * No one can help me here out?
    Thanks Christina
 *  Thread Starter [tinarawatta](https://wordpress.org/support/users/tinarawatta/)
 * (@tinarawatta)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/only-posts-in-specific-category-browsing/#post-237499)
 * Found out the solution!
    its not: `previous_post_index('&laquo; % | ','','yes','
   yes'); next_post_index('% &raquo; | ','','yes','yes');
 * but
    `previous_post('&laquo; % | ','','yes','yes'); next_post('% &raquo; | ','','
   yes','yes');
 * and now it works perfect!
    Thank you all, lg Christina

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Only posts in specific category browsing?’ is closed to new replies.

## Tags

 * [next previous](https://wordpress.org/support/topic-tag/next-previous/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 3 participants
 * Last reply from: [tinarawatta](https://wordpress.org/support/users/tinarawatta/)
 * Last activity: [20 years, 10 months ago](https://wordpress.org/support/topic/only-posts-in-specific-category-browsing/#post-237499)
 * Status: not a support question

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
