[wp-hackers] Post in appropriate category view.
John Blackbourn
johnbillion+wp at gmail.com
Fri Aug 21 08:31:07 UTC 2009
Just wrote a little function for this: http://pastebin.ca/1537418 .
get_category_archive_page() will give you the page number of the
category archive that the current post appears on. It takes two
parameters, the post ID and a category ID. Both parameters are
optional when the function is used within the loop as it'll auto
detect the post ID and the first category ID the post is in.
All you need to do with the result is turn it into a link to the
correct page within the category archive. Eg.
example.com/category/cheese/page/X where X is the result of
get_category_archive_page().
John
2009/8/20 Diaan Mynhardt <diaan at dreamfoundry.co.za>:
> scribu wrote:
>>
>> You might also want to take a look at the Smarter
>> Navigation<http://scribu.net/wordpress/smarter-navigation>plugin.
>>
>
> Thank you for this. I will check it out too.
>
> --
> Diaan Mynhardt
> http://dreamfoundry.co.za
> +27 84 580 6018
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list