Black Friday Sale! Get up to $40 off GP Premium!Learn more

[Resolved] Frustrating conditional tags…

Home Forums Support Frustrating conditional tags…

  • This topic has 3 replies, 2 voices, and was last updated 3 years ago by Leo.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #415971
    Coen

    Hello dear PHP wizzards,

    I have been struggling for an hour now and I am not happy to have to resort to this question to help. I should be able to sort this out myself. But…. ahhhrrrgg. Can’t get it to work.

    I have this:

    Don’t show on home page [works!]

    <?php if ( ! is_front_page()  ) : ?>
          [INSERT_ELEMENTOR id="26162"]
    <?php endif; ?>

    Don’t show on page met id= 22587 [works!]

    <?php if ( ! is_page( 22587 )  ) : ?>
          [INSERT_ELEMENTOR id="26162"]
    <?php endif; ?>

    Together? Can’t get it to work:

    <?php if ( ! is_front_page() || ! is_page( 22587 )  ) : ?>
          [INSERT_ELEMENTOR id="26162"]
    <?php endif; ?>

    Can you please chime in….
    C—

    GP Premium 1.4.3
    #416114
    Leo
    Staff
    Customer Support

    Hi there,

    Can you try:

    <?php if ( ! is_front_page() && ! is_page( 22587 )  ) : ?>
          [INSERT_ELEMENTOR id="26162"]
    <?php endif; ?>
    #416360
    Coen

    Leo! As always—brilliant.

    So what is the difference between && and || — and please forgive my ignorance…

    #416386
    Leo
    Staff
    Customer Support

    No problem 🙂 PHP ain’t easy.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.