[Resolved] Masking GP Hooks on all but Homepage

Home Forums Support [Resolved] Masking GP Hooks on all but Homepage

Home Forums Support Masking GP Hooks on all but Homepage

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #105127
    Cassie Thomas

    Hi Tom,

    I have a GP Hook on my homepage that is currently housing a shortcode gallery right above my footer. Is there a way that I can mask this hook so it only shows on my homepage?

    Thanks,

    Cassie
    http://www.AmherstHall.com

    #105190
    Tom
    Lead Developer
    Lead Developer

    Wrap it in a PHP if conditional:

    <?php if ( is_front_page() ) : ?>
          Anything in here will only show up on the homepage.
    <?php endif; ?>

    Make sure you check the “Execute PHP” checkbox.

    #105420
    Cassie Thomas

    Great Thanks!

    #105495
    Tom
    Lead Developer
    Lead Developer

    You’re welcome! 🙂

    #199987
    Oliver

    Thanks! Where do I find the “Execute PHP” checkbox in WordPress?

    #199990
    Jamal

    Hi Oliver

    Did you add the code to GP hooks? If yes then you can find the execute php checkbox right beneath where you added the code.

    #201589
    Oliver

    Thanks for your answer!But doesenst although I clicked the “execute php buttom” I got the following error message:
    Parse error: syntax error, unexpected ‘if’ (T_IF) in C:\wamp\www\wp-content\plugins\generate-hooks\functions\hooks.php(19) : eval()’d code on line 2

    What should I do?
    Thanks for your help
    Ivo

    #201593
    Tom
    Lead Developer
    Lead Developer

    What’s the exact code you added into the hook?

    #201663
    Oliver

    It was my fault. I forgot to insert the link into the PHP Code.
    It works. Great.
    Thanks!

    #201679
    Tom
    Lead Developer
    Lead Developer

    Awesome 🙂

    #502682
    Mildmac SA (ESA78960895)

    What about the opposite? I want to show a shortcode included in a GPHook in all pages but home page. I mean, I don´t want to show the shortcode in the home, cause I am using a transparent header, but I want the shortcode appears in the rest of the site

    #503005
    Leo
    Staff
    Customer Support
    #503139
    Mildmac SA (ESA78960895)

    Great!!! Done!!!
    Thanks Leo

    #503206
    Leo
    Staff
    Customer Support

    No problem!

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