WordPress is_home() Not Working

is_home() is a very usefull functions in wordpress. just like his name, there use to judge if the page is home page or not, so people can do something special setting in home page from this judge, but sometime, you will fond, it’s not working, is there something wrong? yes, it is. Cause another function name query_posts() be used in this file before is_home() function.

So, if you wont use this function, you must place another named wp_reset_query() before is_home(), like this:


I only will display in homepage! really~

this is cause when this page call is_home(), it will feedback a bool parameter “ture”, but query_posts() stop it.

发布者

迎迎 姚

关于,介词,引进某种行为的关系者,组成介词结构做状语或定语。