WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Exclude Element From Homepage And A Few Inner Pages (4 posts)

  1. tmac187
    Member
    Posted 1 year ago #

    I have a scrolling social bar that I hard-coded in that I have excluded on the homepage using:
    if (!is_front_page()) { ?>

    Can somebody show me how the code should look to exclude a few (not all) of my inner pages from displaying the social bar, as well?

    Thanks!

  2. endocreative
    Member
    Posted 1 year ago #

    If its just a couple pages, you could use the OR logical operator.

    if ( is_front_page() || is_page(2) || is_page(3) ) {
    return; // do nothing
    } else {
    // display social slider
    }
  3. tmac187
    Member
    Posted 1 year ago #

    Worked like a charm! Thank you endocreative!

  4. endocreative
    Member
    Posted 1 year ago #

    You're welcome!

Topic Closed

This topic has been closed to new replies.

About this Topic