[Resolved] GP Hook Conditional Statement

Home Forums Support [Resolved] GP Hook Conditional Statement

Home Forums Support GP Hook Conditional Statement

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

    Can anyone help me with a conditional statement I am trying to insert into a GP hook?

    I want the snippet to appear on all pages EXCEPT archive pages and the page with the id of 27696.

    The code I am using is:

    <?php if (! is_archive() || is_page( 27696 ) ) : ?>
        <?php echo do_shortcode( '[xyz-ihs snippet="Newsletter"]' ); ?>
    <?php endif; ?>

    However, this code isn’t working (the snippet is still appearing on all pages).

    I know the error is on my end — any tips?

    #512377
    Martin

    I got this figured out using this code:

    <?php if (! is_archive() && ! is_page(27696) ) : ?>
        <?php echo do_shortcode( '[xyz-ihs snippet="Newsletter"]' ); ?>
    <?php endif; ?>
    #512475
    Leo
    Staff
    Customer Support

    That’s the one. Glad you figured out 🙂

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