Cyber Week Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

[Resolved] Hooks problem

Home Forums Support Hooks problem

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #162487
    Ivan Maria Spadacenta

    Hi,
    I have a problem with “Before Content” hook.
    I want to exclude my code from category page and from a single page.

    If I use:
    <?php if (!is_category()) : ?>
    To exclude from category page it works.

    If I use:
    <?php if (!is_page('3025')) : ?>
    To exlude from a single page it works.

    If I use:
    <?php if ( !is_page('3025') || !is_category()) : ?>
    I does not work. Hook is fired both in category page and on the single page.
    What am I doing wrong?

    Thank you!

    #162490
    Ivan Maria Spadacenta

    Was my code wrong.
    Changing it to:
    <?php if ( !is_page('3025') && !is_category()) : ?>
    Works! Sorry.. my fault.

    #162500
    Tom
    Lead Developer
    Lead Developer

    Glad you got it sorted! Thanks for sharing your working code 🙂

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