Trouble with add_filter
-
Hi everyone!
I’m writing my first plugin and I have to face with probably small problem. I have such a code:
add_filter( 'the_content', 'my_func' );
And it works, but when I put something like this:if( is_page() ) { add_filter( 'the_content', 'my_func' ); }It doesn’t work. The question is of course “why?”.
And BTW: I check if is it a static page or post by checking post_type in DB. Is there any better solution?
Thanks in advance for any help!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Trouble with add_filter’ is closed to new replies.