Site logo

Archived topic

Frustrating conditional tags...

3 replies · Started by Coen on November 4, 2017

Viewing posts 1–4 of 4

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—

Hi there,

Can you try:

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

Leo! As always—brilliant.

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

No problem :) PHP ain't easy.

This archived topic is closed to new replies.