Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Excerpts, Read more, Pagination (http://forum.bytesforall.com/forumdisplay.php?f=20)
-   -   next/previous - keep it to current category (http://forum.bytesforall.com/showthread.php?t=4914)

sirabi Dec 16, 2009 09:20 PM

next/previous - keep it to current category
 
I would like my next/previous links on multi page and single page posts to be within a single category (the one containing the current post). How do I do this? There's not a single.php file.

Thanks!

juggledad Dec 18, 2009 04:52 AM

Added an RFE to http://forum.bytesforall.com/showthread.php?t=3650

mjrouleau Jan 8, 2010 02:54 PM

This plugin works beautifully, even with posts belonging to more than one category:
http://wordpress.org/extend/plugins/smarter-navigation/

Somehow the plugin detects from which category page the user comes from.

I'm using ATA 3.4.4 and WP 2.8.6

Hope this helps!
M-J

joan Jan 8, 2010 05:23 PM

Using http://wordpress.org/extend/plugins/smarter-navigation/ works on two sites http://www.paperflame.com/content & http://www.enduro.nl but it has to be configured somehow with atahualpa and I'm not sure how. So far it's not working for me. I have installed the plugin and put <code><?php echo '<div class="newer">'; previous_post_smart();echo '</div>'; ?>
<?php echo '<div class="older">'; next_post_smart();echo '</div>'; ?></code> into ATA->CENTRE COL->THE LOOP, but if you look at http://travelhorizonstyle.com.au/cat...e-east/turkey/ and then click "Cappadocia & coastal-splendours" the next/prev is not showing all four posts (tours), ie (Taste of Turkey) is not displayed at all.

Elenis Jan 17, 2010 02:28 PM

I was going to ask exactly the same question :)

I love Atahualpa so far, but keeping Next/Previous in the same category is important to me and I don't have any idea about how it can be done (with or without a plugin).

chiara7 Jan 17, 2010 06:16 PM

I had the same problem, I solved it with the following changes in bfa_next_previous_links.php (bold are the changes)

Code:

/* Next/Previous POST Links (on single post pages)
  in next_post_link "next" means newer posts
  Available parameters for $location: Top, Middle, Bottom. Default: Top  */

function bfa_next_previous_post_links($location = "Top") {

global $bfa_ata;

        if ( is_single() AND strpos($bfa_ata['location_single_next_prev'],$location) !== FALSE AND
       
    // don't display on WP Email pages
    intval(get_query_var('email')) != 1 )  {

                echo '<div class="navigation-'.strtolower($location).'">
                <div class="older' . ($bfa_ata['home_single_next_prev'] != '' ?
        '-home' : '') . '">';

                $bfa_ata['next_prev_orientation'] == 'Older Left, Newer Right' ?
                previous_post_link('%link', '%title', 'yes', TRUE) :
                next_post_link('%link', '%title', TRUE);


                echo ' &nbsp;</div>' . ($bfa_ata['home_single_next_prev'] != '' ?
        '<div class="home"><a href="' . $bfa_ata['get_option_home'] . '/">' .
        $bfa_ata['home_single_next_prev'] . '</a></div>' : '') .
                '<div class="newer' . ($bfa_ata['home_single_next_prev'] != '' ?
        '-home' : '') . '">&nbsp; ';

                $bfa_ata['next_prev_orientation'] == 'Older Left, Newer Right' ?
                next_post_link('%link', '%title', TRUE) :
                previous_post_link('%', '%title', 'yes', TRUE);

                echo '</div><div class="clearboth"></div></div>';

        }

}


sorry for my poor english........

victorm Feb 3, 2010 02:08 PM

thank, Chiara - did not even think of this before, a great addition to some of my blogs.

James Patrick Aug 27, 2010 01:21 AM

chiara7, Thanks for the php code, which eventually helped to solve my problem, that was a real pain for me!


____________________________
php chat for website

esvl Sep 30, 2010 09:57 AM

With Atahualpa 3.5.3, there is an theme option for that purpose:
"Center Column" / "Next-Previous Navigation" / "New: Keep next/prev. links on SINGLE post pages to same post category?"
Unfortunatly, it doesn't work for me.

The links are not visible in the single post view, while I am locking a ast that another one of the same category.

Any idea ?

- Meantime, I have tested with a categery having more post, and in that case, no pb...
How to report a bug? ;)

BTW, I very thank the team for this so great/configurable theme!!!

juggledad Sep 30, 2010 06:47 PM

what version of Atahualpa and WP?
What is the url?
How many categories do you have on each post?

esvl Oct 1, 2010 02:28 AM

Hi juggledad

I am using ATA 3.5.3 and WP 3.0.1 (FR).
Option "Keep next/prev. links on SINGLE post pages to same post category?" is checked.
Posts have been imported from Joomla! with the related plugin.

The "badly-working" "archive of category" URL is here :
(there are 2 posts in this category and only this ones)
http://www.urlgone.com/2fcb2c/

Here is another "good-working" "archive of category" URL:
(there are 5 posts in this category and only this ones)
http://www.urlgone.com/4b65b0/

(
BTW, I would have LOVED being able to set the sorting order Next/Previous based based on URL (alphabetic order) instead of in chronologic order (or another mean to set the post order as I'd like)
)

Many thanks
Eric

juggledad Oct 1, 2010 05:09 AM

Ok, here is the problem as I see it.

The new option 'Keep next/prev. links on SINGLE post pages to same post category?' does work IF THERE IS ONE CATEGORY PER POST.

originally the next/previous navigation went from post to post, and now it will follow the FIRST CATEGORY ID associated with the post. Category ID's are assigned numerically in the order they are created - not alphabetically. So when you go to a post and there are five categories associated with it there is no way to tell which category line to follow.

so if you want this to work, make sure there is only one category assigned to the post.

esvl Oct 1, 2010 07:45 AM

This is what i also suspected...
And your information is good to know.
But actually this is not the case in my two exemples, all the post belong to a single category... There must be something else.

juggledad Oct 1, 2010 08:17 AM

what do you have set at ato->Next/Previous Navigation for '"Newer Post" link on SINGLE post pages' and '"Older Post" link on SINGLE post pages'?

esvl Oct 1, 2010 09:02 AM

I have left the default values (&laquo; %link)
We can see them in action through the second link i posted above.

I Have tried to leave in the second link/category only 2 posts.
And with only two posts, it works fine too. So the problèm i have with my first link does'nt come from the nb of posts.


All times are GMT -6. The time now is 07:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.