Problems with the WordPress loop [closed]

You don’t need any plugins to accomplish this. In fact, this is not really a use case for a masonry layout since the heights of the images are all the same. Masonry.js is for varying post heights. You just need a counter to keep track of alternating rows, and each alternating row put the small column first instead of second. Set a counter to 0 like so:

$i = 0;

Then after each post increment it by one like so:

$i++;

Then you need to use mod to check if it’s evenly divisible by 2 (alternate row) or not. If it is, put the small column first instead of second. Check like this:

if($i % 2 == 0) { 

    //...this is an alternate row...
    //...put your markup here...

} else {

    //...this is a regular row...
    //...put your markup here...
}

From the looks of your markup, you might need to modify it so it’s all within one loop in order for this to work.