Weblog Tools Collection: is_home(), is_archive() not Working? Here is a Fix

Quite recently, is_home() and is_archive() stopped working for me. I mean, that these conditional tags stopped working for me and the intended code I had was not performing as expected.

I did a bit of digging around, however I did not find any conclusive answers to what was wrong. However, I did find a solution at this forum post, and after including an additional snippet it started working fine.

If you are facing a problem with the is_home() function, you can use the wp_reset_query(); function before you use the conditional checks to fix the issue.

I am still looking into the internal code as to why this is happening, will update the post once I find an answer to this problem.

Weblog Tools Collection: is_home(), is_archive() not Working? Here is a Fix

Quite recently, is_home() and is_archive() stopped working for me. I mean, that these conditional tags stopped working for me and the intended code I had was not performing as expected.

I did a bit of digging around, however I did not find any conclusive answers to what was wrong. However, I did find a solution at this forum post, and after including an additional snippet it started working fine.

If you are facing a problem with the is_home() function, you can use the wp_reset_query(); function before you use the conditional checks to fix the issue.

I am still looking into the internal code as to why this is happening, will update the post once I find an answer to this problem.

We will be happy to hear your thoughts

Leave a reply

TechEggs
Logo