Question

I'm trying to show AdRotate content just in the main page of my blog by using this conditional tags: is_home() && is_front_page() also this other too is_home() || is_front_page() and didn't work. If I do this in header.php: echo is_home(); I get 1 as result which make me think that's TRUE. Also if I try with echo is_front_page() I get the same result. What is wrong then?

Was it helpful?

Solution

is_home() && is_front_page() will always be false. The two are mutually exclusive. The second version is the correct usage: is_home() || is_front_page(). Are you aware of the difference between is_home() and is_front_page()?

Take a look at the plugin FAQ page for more info on homepage usage: http://wordpress.org/plugins/widget-logic/faq/

Also further reading on the conditionals you're attempting to use: http://codex.wordpress.org/Function_Reference/is_home http://codex.wordpress.org/Function_Reference/is_front_page

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top