[wp-hackers] Post in appropriate category view.
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
2009/8/20 Diaan Mynhardt <diaan at dreamfoundry.co.za>:
> scribu wrote:
>> You might also want to take a look at the Smarter
> Thank you for this. I will check it out too.
> Diaan Mynhardt
> +27 84 580 6018
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers