Justacheesyname
Forum Replies Created
-
Exactly.
Pretty much a noob question on my side… Didn’t realise that if overflowing the grid inside a row would make it jump the line down.Thanks a lot for your time.
I can’t work with things like
width: 50%
as in the example.
Just to show a bit of code from the blog-template.php and where my problem resides.At the beginning of the foreach:
<?php if($i % 2 == 0): ?> <div class="row"> <? endif ?>
***
At the end:
<?php if($i % 2 != 0): ?></div><!--xx End of content row --> <? endif ?> <?php endforeach; ?> <?php if($i % 2 == 0): ?></div><!--xz Same End of content row --> <? endif ?>
Those last 2
</div>
are in fact the same, it’s only needed if the number of posts is odd when theforeach
has been finished.Yes, I have a custom CSS and a custom child theme from the Neodym Theme, in which I had to modify the blog-template too so I could show more than one post in a row (i.e. 2 columns).
So inside the mainforeach
I use $i to see if it’s pair, if it’s pair I close the needed</div ... >
to jump to the next row [the theme uses bootstrap]. May I should do this in my style.css instead of changing the layouts in the templates?The example is pretty much it, but I’m still looking into the plugin and the code to really understand how to generate a template like that since getting 2 posts at once doesn’t seem to be a clean option inside the plugin loop.
PS: The example’s code is
<?php echo do_shortcode(<strong>[</strong>'[ajax_load_more post_type="ajax_more" posts_per_page="2" transition="fade" button_label="Load More Posts"]'<strong>]</strong>) ?>
and should be without the brackets
<?php echo do_shortcode('[ajax_load_more post_type="ajax_more" posts_per_page="2" transition="fade" button_label="Load More Posts"]') ?>
Thanks for the quick reply! ??