How to get pagination to work with 2 wordpress loops

So you have a big problem here and a pack of small problems. The big one is — pagination cannot be reliably changed within template. It just doesn’t work like that. Pagination and main query are processed before template is ever reached. So I would guess information you are coming upon is about the need … Read more

Getting page slug

If you are inside the loop, you don’t need to access global $post, you already have $post variable accessible in your local scope, and this variable holds the data from current loop iteration. If you are outside the loop, then you need to access global $post first, and it will hold whatever data it was … Read more

Wpdb get->results to out the the month from the db

You could use the MONTHNAME(dato) on your select Like $rows = $wpdb->get_results( “SELECT MONTHNAME(dato) as month_name, avg(fiske_vaegt) as fiske_vaegt FROM `wp_registreringer` WHERE MONTH(dato) = 11 AND YEAR(dato) = 2017;”); and access it like this echo $row->month_name

using wp_get_attachment_image_src in foreach loop

First in your first loop why do you break it? if there is no image in image_5 if someone just skip this and continue to image_6? Second the ACF image field can return you an array with all the sizes. you need to set the field to return you Image Array And then you can … Read more

Loop 3 posts column wise and continue the loop into same columns

If that col-4 class does what your example suggests it does, then just wrapping each post in col-4 would achieve the same effect: <div class=”col-4″> Post 1 </div> <div class=”col-4″> Post 2 </div> <div class=”col-4″> Post 3 </div> <div class=”col-4″> Post 4 </div> <div class=”col-4″> Post 5 </div> <div class=”col-4″> Post 6 </div> Then you … Read more