[Resolved] Hooks

Home Forums Support Hooks

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #124879
    Richard Bland

    Hi Tom,

    I’m building a site as we speak and want to add in some PHP code via the HOOKS add-on ‘after header’. I’ve used this before to add in HTML code and has worked perfectly, but in this instance I’d like to only have the hook appear on the front page.

    What I am thinking is to use the if home page statement PHP and then echo out my div container, which in turn contains all my bits and pieces.

    If I insert some PHP into the hook via the admin dashboard, will this work? and do you happen to know how to write that if home page statement correctly? 🙂

    Kind Regards,

    Richard Bland
    Owner, BhambraBland
    --
    w: www.bhambrabland.co.uk
    e: richard@bhambrabland.co.uk
    --

    #124938
    Tom
    Lead Developer
    Lead Developer

    You can add PHP to the hooks, you just have to check the “Execute PHP” checkbox below the hook.

    For the front page:

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

    Let me know if you need more info 🙂

    #125197
    Richard Bland

    As always Tom, much appreciated and great stuff! F*ing genius comes to mind… 🙂

    Kind Regards,

    Richard Bland
    Owner, BhambraBland
    --
    w: www.bhambrabland.co.uk
    e: richard@bhambrabland.co.uk
    --

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