[Resolved] Exclude hook on 1 page

Home Forums Support [Resolved] Exclude hook on 1 page

Home Forums Support Exclude hook on 1 page

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #425444
    Alan

    Hi lads,
    I have had the slider on my website excluded from loading on my contact page
    but I have changed something and now it is INCLUDED.

    Using GP Premium 1.4.3

    Here is the code

    <?php if ( ! is_page( 35 ) ) : ?>
    
    [huge_it_slider id="3"]
    
    <?php endif; ?>
    
    <div class="hook-slider">
        <huge_it_slider id="3">
    
    </div>
    
    <?php if ( ! is_page( 35 ) ) : ?>
    <div class="hook-logos">
    Payments accepted with
    
    </div>
    <div class="hook-logos">
    <img src="http://-.biz/wp-content/uploads/2017/11/Bitcoin_logo.jpg">
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    <img src="http://-.biz/wp-content/uploads/2017/11/Byteball-logo.jpg">
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    <img src="http://-.biz/wp-content/uploads/2017/11/phore-logo.jpg">
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    <img src="http://-.biz/wp-content/uploads/2017/11/pivx-logo.jpg">
    
    </div>
    <?php endif; ?>
    #425493
    Leo
    Staff
    Customer Support

    Hi there,

    Looks like you added the slider twice and one of them is not wrapped in the <?php if ( ! is_page( 35 ) ) : ?> statement?

    #425731
    Alan

    hi again Leo,

    yea ive been getting a bit bogged down with the little bit of code I’m trying to impliment.

    ok i have it simplified now but still no joy . . .

    <?php if ( ! is_page( 10 ) ) : ?>
    <div class="hook-slider3">
        [huge_it_slider id="3"]
    </div>
    <?php endif; ?>
    
    <div class="hook-logos-text">
    Payments accepted with
    
    </div>
    
    <div class="hook-logos">
    <img src="http://-.biz/wp-content/uploads/2017/11/Bitcoin_logo.jpg">
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    <img src="http://-.biz/wp-content/uploads/2017/11/Byteball-logo.jpg">
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    <img src="http://-.biz/wp-content/uploads/2017/11/phore-logo.jpg">
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    &nbsp;
    <img src="http://-.biz/wp-content/uploads/2017/11/pivx-logo.jpg">
    
    </div>
    #426002
    Leo
    Staff
    Customer Support

    so you don’t want it on front page?

    Try this instead: <?php if ( ! is_front_page() ) : ?>

    #426033
    Alan

    hi leo, no i want to exclude it from the contact page

    ?page_id=35

    i have added the page number

    <?php if ( ! is_page( 35 ) ) : ?>
    <div class="hook-slider3">
        [huge_it_slider id="3"]
    </div>
    <?php endif; ?>
    #426041
    Leo
    Staff
    Customer Support

    Did you check execute PHP?

    #426069
    Alan

    O M G

    apologies Leo,

    clicking the little box to “execute PHP”
    really does help in these matters.

    Apologies for the wild goose chase.

    A

    #426166
    Leo
    Staff
    Customer Support

    No problem 🙂

    Glad you figured out!

    #486687
    mor

    Is it possible to exclude the same items from more than one page in the same snippet?

    #486817
    Leo
    Staff
    Customer Support
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.