2

I'm developing a website using WordPress 3.3.2 and have the Front Page and Posts Page set to use static pages. I'm trying to show different menus using wp_nav_menu() for the static front page and static posts page respectively.

I was able to find is_front_page() to check for the front page, however after hours of banging my head against the WordPress Codex and checking the mighty Google I can't find a comparable function or method to check if the user is currently on the static posts page.

Has anyone run into this? Any help would be greatly appreciated!

6

There are two options:

// If the current page is the blog posts index,
// but is NOT the site front page
if ( is_home() && ! is_front_page() )

or

// If the current page has the ID of the
// page assigned to display the blog posts index
if ( is_page( get_option( 'page_for_posts' ) )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.