Home > WordPress > How to Navigate Posts Only in The Current Category using Smarter Navigation Plugin and Atahualpa Theme of WordPress

How to Navigate Posts Only in The Current Category using Smarter Navigation Plugin and Atahualpa Theme of WordPress

If you want to change the existing navigation in Atahualpa Theme of your WordPress website that navigate all post based on the order of the general Post ID no matter which category you choose, become the smarter technique which will navigate based on the current category that selected by user, then this following modification is for you! As we know, Atahualpa theme has provided the previous/next link when we display the certain post in the top of the post page. Unfortunately, by default, when we choose the certain category, then we navigate through that navigation post link, it will avoid the selected category. Now, after you implement this following modification, you will be able to navigate only through the posts that located in the certain category that you have choosen. Isn’t smarter, huh?

  1. Download the Smarter Navigation plugin.
  2. Upload this plugin to your /wp-content/plugins/ and then extract it.
  3. Activate this plugin from your wp-admin.
  4. Open your /wp-content/themes/{youratahualpaname}/functions/bfa_next_previous_links.php file, and find this code:

    137
    138
    
    		previous_post_link($bfa_ata['single_next_prev_older']) : 
    		next_post_link($bfa_ata['single_next_prev_newer']);

    then replace with this following code:

    137
    138
    
    		previous_post_smart($bfa_ata['single_next_prev_older']) : // previous_post_link replaced by previous_post_smart in order to navigate only in the current category using Smarter Navigation plugin, modified by Masino Sinaga, Januari 16, 2010
    		next_post_smart($bfa_ata['single_next_prev_newer']);  // next_post_link replaced by next_post_smart in order to navigate only in the current category using Smarter Navigation plugin, modified by Masino Sinaga, Januari 16, 2010

    Find again this code:

    147
    148
    
    		next_post_link($bfa_ata['single_next_prev_newer']) : 
    		previous_post_link($bfa_ata['single_next_prev_older']);

    then replace with this following code:

    147
    148
    
    		next_post_smart($bfa_ata['single_next_prev_newer']) : // next_post_link replaced by next_post_smart in order to navigate only in the current category using Smarter Navigation plugin, modified by Masino Sinaga, Januari 16, 2010
    		previous_post_smart($bfa_ata['single_next_prev_older']); // previous_post_link replaced by previous_post_smart in order to navigate only in the current category using Smarter Navigation plugin, modified by Masino Sinaga, Januari 16, 2010

The conclusion: All you need to do is simply replace the link with smart in the previous_post_link and next_post_link function call in bfa_next_previous_links.php file belongs to Atahualpa theme. Afterwards, you can navigate through the posts only that located in the certain category you chose.

  • Share/Bookmark
423 views Print This Post Print This Post

  1. January 19th, 2010 at 21:37 | #1

    Hello Masino,

    I tried doing exactly as you wrote in your post, but it’s not working for me. I use Atahualpa 3.4.4 on my site – if you have some time, could you be so nice to tell me what I am doing wrong? As you can see, the Next/Previous links on my site don’t point to posts in the same category, but to the Next/Previous post in date.

  2. January 30th, 2010 at 12:12 | #2

    Hi Rain,

    What browser are you using? The problem usually caused by the inactive cookies in the browser. I also have encountered the same problem while using IE, but not in FF. After investigating for a while, I found that the problem caused by the disabled cookies in IE. After enabling the cookies, then it worked properly in IE. Meanwhile, there is no problem with FF since the cookies was enabled in it. Hope it helps.

  1. No trackbacks yet.