[wp-hackers] Post in appropriate category view.

scribu scribu at gmail.com
Thu Aug 20 19:32:25 UTC 2009


On Thu, Aug 20, 2009 at 5:31 PM, Dave Mee <davemee at gmail.com> wrote:

> Hi Diaan,
>
> I have a very rudimentary plugin designed to provide 'page X of Y' feedback
> features to wordpress - however, when I wrote it I was new to writing WP
> plugins, so it's a template tag you'll need to insert manually into your
> theme.
>
> /**
>  * Identify which page a post is on, based on the number of posts per page
> option
>  *
>  * @param string $postid Required. The ID of the current post
>  * @param string $category Category list, either a single ID or multiple,
> separated by commas
>  * @return int The page the post occurs on.
>  *
>  */
> function get_current_page($postid=0, $category = '')
>
> If you're interested in giving it a whirl (and helping me be sure it works
> for other people before releasing it) drop me a line and I'll send it over
> to you.
>
> It is a computationally heavy calculation, but this plugin implements
> cacheing which should ease the burden.


You might also want to take a look at the Smarter
Navigation<http://scribu.net/wordpress/smarter-navigation>plugin.


> While I'm here - does anyone have any good advice on how to implement
> query-parameter style parsing for functions? Is this still the official way
> to implement them, rather than multiple parameters?


You can use wp_parse_args()


-- 
http://scribu.net


More information about the wp-hackers mailing list