Page with Multiple Loops Breaking Pagination

The content is the same because the loops are the result of the get_posts() call which does not take into account the page you are on. In short you are not looping through the results of your WP_Query but instead the get_posts() . Try replacing get_posts and the foreach with a while loop using the … Read more

What PHP Needed to Make One Loop with Multiple Styling?

this is your answer… however like Kaiser said, you should really take some time to read a little… <?php $i=0; if ( have_posts() ) while ( have_posts() ) : the_post(); if($i==0) { ?> // YOUR FIRST POST CONTENT } else if(($i==1) || ($i==2) || ($i==3)) { // POST 2, 3, 4 } else { // … Read more

Last class on last headline?

$count = 1; is set in the while loop, so every time the loop runs it sets to 1 again. Place it before your loop and it will work. $count = 1; if (have_posts()) : while (have_posts()) : the_post(); Ow and the $count++ is outside the loop so it will only run after all the … Read more

How to Loop with the final result formatted differently?

I’m not sure of the context for this, but query_posts probably isn’t what you want to use. (See this answer). (Untested). I would use get_posts: $posts = get_posts(array( ‘numberposts’=>-1, ‘category’=>0 )); And then use wp_list_pluck to get the titles: $post_titles = wp_list_pluck($posts,’post_title’); $post_titles = array_map(‘esc_html’,$post_titles); Finally, the php implode function an list them with commas: … Read more