On Wed, May 12, 2010 at 8:12 AM, John Blackbourn <[email protected]> wrote: > On Wed, May 12, 2010 at 2:45 AM, Danny G Smith <[email protected]> wrote: >> It appears that is_page is not sanitizing the input text, at least that is >> my guess, when I use 'Education & Outreach' which it the page title, it does >> not work, but if I use the page number 25 it does. > > is_page() only accepts a page ID or an array of page IDs to check. It > would probably be useful if it did accept page names (or more > specifically, page paths). > > I usually stick a wrapper function in my theme's functions.php file: > > function is_page_by_name( $name ) { > $page = get_page_by_path( $name ); > if ( $page ) > return is_page( $page->ID ); > return false; > } > > John >
You need to use the page slug when calling that function by the way, eg in your case is_page_by_path( 'education-outreach') . _______________________________________________ wp-testers mailing list [email protected] http://lists.automattic.com/mailman/listinfo/wp-testers
