Jump to content
Sign in to follow this  
michaelchristonsayerscom

Previous/Next navigation - How can you make it stick within a category?

Recommended Posts

michaelchristonsayerscom    0
michaelchristonsayerscom

Hi there (Third and final question of the day!) Is there a way in iBlogPro to make the next/previous navigation at the top of the page stick to specific category? So if user was in category "X" then the next/previous navigation would cycle through category "X" posts only. If I was in category "Y" it would cycle through category "Y" posts only. Any thoughts? Thanks in advance again (really digging the theme... and making great progress on using it as a theme for membership site... Just need to get these things sorted so I can truly be rocking'n'rolling!) AS

Share this post


Link to post
Share on other sites
cmunns    16
cmunns

look for functions_body.php and search for this: ` function pagelines_postnav(){?>

<?php previous_post_link('%link', TRUE) ?> <?php next_post_link('%link', TRUE) ?>
<?php } ` make sure as above you add the TRUE parameters.

Share this post


Link to post
Share on other sites
michaelchristonsayerscom    0
michaelchristonsayerscom

Hi there - Thanks for the answer ...but that didn't seem to make any difference :-( If I navigate to a post in category "X" and I then use the prev/next navigation at the top of the page.. then as soon as it gets to the end of the posts within that category the prev/next navigation just goes onto posts in the next category... Any other ideas? Thanks in advance, AS

Share this post


Link to post
Share on other sites
catrina    103
catrina

Try replacing

<?php previous_post_link('%link', TRUE) ?>
and
<?php next_post_link('%link', TRUE) ?>
with these codes: ` <?php previous_post_link('%link', TRUE, 'EXCLUDEDCATEGORYID#HERE') ?> <?php next_post_link('%link', TRUE, 'EXCLUDEDCATEGORYID#HERE') ?> ` Replace
EXCLUDEDCATEGORYID#HERE

with the category ID numbers for the categories you want excluded. (Separate the category ID numbers with commas like so: 12, 6, 15... etc.)


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
michaelchristonsayerscom    0
michaelchristonsayerscom

Thanks for the suggestion Catrina, however regrettably that won't work for me either as I need the next/prev to work on all categories... So excluding a category would cause a problem... In other words, when in category "X" next/prev works within category "X" posts only... but when category "Y" next/prev works within category "Y" posts only. Being more a user than super-techie, the ability to navigate like this within a single category seems quite intuitive... so it would be great to be able to make it happen. :) Thanks again for the suggestion. AS

Share this post


Link to post
Share on other sites
catrina    103
catrina

I'm not quite sure why Adam's suggestion wouldn't work. It is a suggested function as shown in the Codex here: http://codex.wordpress.org/Function_Reference/next_post_link#Text_As_Link.2C_Without_Post_Title.2C_Within_Same_Category


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
kastelic    6
kastelic

I think you are missing the second parameter which I have used the default for below:

next_post_link('%link', '%title', TRUE)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×