Site logo

Archived topic

Hooks problem

2 replies · Started by Ivan Maria Spadacenta on December 30, 2015

Viewing posts 1–3 of 3

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!

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

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

This archived topic is closed to new replies.