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:
<?php wp_reset_query(); if ( is_home() ) { ?> I only will display in homepage! really~ <?php } ?>
this is cause when this page call is_home(), it will feedback a bool parameter “ture”, but query_posts() stop it.
| anyShare分享到: | |
| |
Posted on 5,八 |
Posted by 姚 迎迎 










