How to split the loop every 2 and 5 results? [closed]

Yes you can do that using $wp_query->current_post inside the loop. It returns the current posts index number inside the loop (starting form 0). Have a look at the following code block <?php global $wp_query; while(have_posts()){ the_post(); the_title(); //do your other stuff if($wp_query->current_post==1){ //do what you want to do after 2nd post }else if($wp_query->current_post==5){ //do what … Read more

Split database on large site?

I had a similar issue on a website with ~100k rows in wp_posts and ~500k in wp_postmeta. Truth is WordPress have some really slow queries in the admin when you start to have a lot of posts. The best way to find the bottleneck is to use the Debug Bar plugin. You will probably find … Read more

Retrieve posts inside foundation tabs and tab-content split by 3 per row

I managed to ‘solve’ the problem with the code below. It’s not a pretty solution but it does the job. Any adjustments to the code to make it more pretty are welcome. <?php /* Template Name: Page information */ get_header(); ?> <div class=”row”> <div class=”main-wrap” role=”main”> <?php do_action( ‘foundationpress_before_content’ ); ?> <div class=”row”> <div class=”column”><a … Read more