Tag Info

New answers tagged

2

It is quite hard to properly answer your question with the amount of context in your question, but I am going to try to use the context from your previous question Having a bit more context here on template, and if I read this correctly, this is on your index.php, I still believe and stand by my point that pre_get_posts is your answer. Tackle this problem ...


2

Don't run a new query for your CPT at every iteration of the main Loop. Pull it once, outside the Look with 'posts_per_page' => 4 then increment it as you go. In other words: $counter = 1; $loop = new WP_Query( array( 'post_type' => 'post', 'posts_per_page' => 20 ) ); $inner_query = new WP_Query( array( 'post_type' => ...



Top 50 recent answers are included