I use a headway template, and have tried to place conditional tags inside
footer.php, in order to display a code only in home page, but the code is not working how I want.

Normally, the code Test1,2 or 3 should appear on the front page, but Test4 is appearing, and I think that the conditionals return false, but don’t understand why.

This is the code that I used:
(from http://codex.wordpress.org/Conditional_Tags)

if ( is_front_page() && is_home() ) {
        echo "<!--Test1-->"; // Default homepage
} elseif ( is_front_page() ) {
        echo "<!--Test2-->"; // static homepage
} elseif ( is_home() ) {
        echo "<!--Test3-->"; // blog page
} else {
        echo "<!--Test4-->";   //everything else

I mention that normal php statement works, example:

if( 1==1  ){
    echo "<!--Test0-->";

Does somebody know why the wordpress conditionals don’t work in my code?

Read more here: Proper placement for WordPress conditionals(they return false)


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: