Questions tagged «wp-reset-query»

1
自定义循环后是wp_reset_postdata()还是wp_reset_query()?
阅读一些有关的东西query_reset_postdata,query_reset_query使我感到困惑。例如: 是否需要同时使用wp_reset_postdata和wp_reset_query? http://www.poststat.us/properly-reset-wordpress-query/ 以上指出您仅应query_reset_postdata()在使用“单独查询”时使用。在example2中有一条评论: WP_Query( $args ) = wp_reset_postdata(); 和 query_posts ( $args ) = wp_reset_query(); 确实不应该使用,wp_reset_query因为您不应该使用query_posts !? 在WP Codex中,它指出您应该wp_reset_query()在自定义循环后使用(第一个示例)http://codex.wordpress.org/Function_Reference/wp_reset_query 那么,法典是错的吗?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.