Tag Info

Hot answers tagged

3

Your problem is your custom query. Do not use variables that is used by default by Wordpress. $posts and $post is Wordpress reserved global variables. Change $post to a unique variable, something like $posts_query. When using get_posts and you need to setup postdata to make use of template tags, you have no choiche but to use $post as setup_postdata() ...


2

Your logic in your code is wrong. Read your code in plain English. If the current post is number 3, show my custom content, else, show the posts as normal. What you want is the following If the current post is number 3, show my custom content. Show all my posts as normal To achieve this, you need only wrap your custom content in your ...


2

query_posts - You should never ever use query_posts. Apart from what @Rarst has said, the really big issue with query_posts is, it breaks the main query object ( stored in $wp_query ). A lot of plugins and custom code relies on the main query object, so breaking the main query object means that you are breaking the functionalities of plugins and custom code. ...



Only top voted, non community-wiki answers of a minimum length are eligible