[Resolved] Disable hooks on blog posts/page

Home Forums Support [Resolved] Disable hooks on blog posts/page

Home Forums Support Disable hooks on blog posts/page

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #42021
    Laura

    I wanted to add a simple link before the the page title, so I used hooks addon and used “before content” to do this. This works fine. However, I would only like this link to appear on static pages and not on the blog posts. Is this possible and how would I go about it?
    The site is being developed but can currently be seen at: http://design.laikanet.com/jorkal/

    I’m a bit shaky when it comes to PHP, but I can edit the script when told what to do ๐Ÿ˜€
    I found <?php do_action(‘generate_before_main_content’); ?> in single.php but I’m not sure what next.

    Oh and I have created a child them if that matters.

    Thanks you kindly,
    Laura

    #42095
    Tom
    Lead Developer
    Lead Developer

    Hi Laura,

    You can use PHP in the hook to target certain areas.

    For example, to only show it on pages, you would do this:

    <?php if ( is_page() ) : ?>
    STUFF IN HERE WILL ONLY SHOW ON PAGES
    <?php endif; ?>

    Then you’ll need to check the “Execute PHP” box, and you’re good to go.

    Thanks!

    #42167
    Laura

    Thanks Tom, I shall try that ๐Ÿ™‚

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