How to execute the condition correctly in function.php
-
hey guys, what is the correct way to execute the condition correctly in function.php ?
There is no change when I write the following code :if (is_tag()){ echo "hi my name is mohamamad"; }
but when Write like this the code works:
function test(){ if (is_tag()){ echo "hi my name is mohamamad"; } } add_action("wp_head","test");
as you see the code only works when I put it in header.php! why this is happen and what’s the correct way to execute function and condition in function.php ?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How to execute the condition correctly in function.php’ is closed to new replies.