I am using previous/next_post_link but I would like state "Previously in (current category name)" right now i have %title in its place.
Is there an easy way to automatically pull the category name into the link
<div class="alignleft"><?php previous_post_link('« %link', 'Previously in %title', TRUE, '102'); ?></div>
<div class="alignright"><?php next_post_link('%link »', 'Next in %title', TRUE, '102'); ?></div>
Thanks!
Anonymous
Unregistered
Posted 3 years ago #
I'm also looking for the exact same thing, anyone know the answer to this?
thirdeyetc
Member
Posted 3 years ago #
I too would like to do this. I have an online store, and it'd be great if I could get it to say "next store item" or "next news item" etc..
has this been resolved? Currently using title as above.
slackermethod
Member
Posted 3 years ago #
You guys are looking for something like this.
<div class="alignleft"><?php
$category = get_the_category();
$cat_name = $category[0]->cat_name;
previous_post_link('« %link', 'Previously in '.$cat_name, TRUE, '102'); ?></div>
<div class="alignright"><?php next_post_link('%link »','Next in '.$cat_name,TRUE, '102') ?></div>
- Slacker
http://www.theslackermethod.com