[wp-hackers] static pages status?

Ryan Boren ryan at boren.nu
Sun Oct 3 19:04:34 UTC 2004


On Sun, 2004-10-03 at 10:43 -0700, Arthur Jennings wrote:
> Ryan, what would be the best way to selectively run code in page.php
> depending which page is called? Based on the slug? Or something else?
> 
> 
> > I'm working on proper page/sub-page URIs.  A page named "About" will
> > be /about instead of /site/about.  A page named "Me" with a parent of
> > "About" will be /about/me.

I just added some code that allows you to pass an id, name, or nicename
to is_single(), is_page(), is_category(), and is_author().  For example,

is_page() - True if a page is being served.
is_page(3) - True if a page with the ID of 3 is being served.
is_page('About Me') - True if the page title is 'About Me'.
is_page('about-me') - True if the page nicename is 'about-me'.

Ryan





More information about the hackers mailing list