Two posts in same div – WP loop

This is really just a matter of logic. You need to conditionally print the div markup. The counter in $wp_query will let you chose every second post. if (have_posts()) { echo ‘<div class=”posts-wrapped”>’; while (have_posts()) { the_post(); if (0 !== $wp_query->current_post && 0 === $wp_query->current_post%2 ) { echo $wp_query->current_post.'</div><div class=”posts-wrapped”>’; } the_title(); echo ‘<br />’; … Read more

Repost post on specific date every year

Rather than re-post the posts, we can create a custom query for the current day’s post regardless of year. We use current_time to get the current day and month according to the site’s timezone settings, then we create a new query containing date parameters for month and day. We don’t specify a year, so it’ll … Read more

Transient pagination not working properly

Short answer: You are making the same query no matter what page you are, but you’re expecting a different result. Long answer: The query should be different for second page, having paged=2, so your query (and transients) with pagination should look like this: $paged_var = get_query_var( ‘paged’ ) ? get_query_var( ‘paged’ ) : 1; if … Read more

WordPress Loop Through Particular Pages

Perhaps something like this $thepages = array (21,22,23); foreach ($thepages as $thepage) { $page_data = get_page( $thepage ); echo “<h3>$page_date->post_title</h3>”; echo apply_filters(‘the_content’, $page_data->post_content); // spray out other page content } See more here