WordPress.org

Ready to get started?Download WordPress

Forums

if ( ! is_page() ) not working, need help... (6 posts)

  1. Spencer Hill
    Member
    Posted 1 year ago #

    Heya,

    None of these statements seem to work...
    if( ! is_page('blog') ) { wp_breadcrumbs(); }
    or
    if( !is_page('blog') ) { wp_breadcrumbs(); }
    or
    if( ! is_page(950) ) { wp_breadcrumbs(); }
    or
    if( !is_page(950) ) { wp_breadcrumbs(); }

    Yet this one does:
    if( !is_front_page() ) { wp_breadcrumbs(); }

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    You need to state what you're trying to do in the bigger picture.

  3. Jose Castaneda
    Member
    Posted 1 year ago #

    Please help us understand a little more as to what you are trying to do. Are you trying to display the breadcrumbs when you're not viewing only a specific page? By the looks of the way you have the code I'm only guessing you have a static front page and you want the breadcrumbs to show when it's not the front page and you don't want it to show when you are viewing the blog postings, correct?

  4. Spencer Hill
    Member
    Posted 1 year ago #

    Sorry for the confusing post. Re-reading it I see how I left some information out:

    I'm trying to display the breadcrumbs function an all pages except the blog page (page 950).

    I think I just realized my flaw though, it should be if ( is_page() && ! is_page(950) )...

  5. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    if the 'blog' page is the 'posts page' as set in the dashboard under settings - reading, then try:

    is_home()

    http://codex.wordpress.org/Conditional_Tags

  6. Spencer Hill
    Member
    Posted 1 year ago #

    Good point alchymyth, thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic