Problem of display with Masonry
-
Hi !
Ajax Load More is really a great plugin and I would like to use it for my posts displayed in Masonry.
But I have two problems with my posts and I think they are caused by the code that I use in the “Repeater Templates”.
My first problem is that my button “Load More” works but the posts are displayed in a list and not in Masonry.
And my second problem is that after clicking for the first time on Load More button, the posts restart from the beginning (so the ten first posts appear a second time).I use a archive-masonry.php for the posts :
<?php if (have_posts()) { echo '<div class="post-archive">'; while (have_posts()) : the_post(); $current = $wp_query->current_post + 1; if ($current == 1) { if ($show_first == true) { echo '<div class="post-archive-standard">'; is_featured() ? get_template_part('templates/content', 'featured') : get_template_part('templates/content', 'standard'); echo '</div>'; } echo '<div class="post-archive-masonry">'; echo '<div class="row">'; if ($show_first == false) { echo '<div class="col-masonry col-lg-' . 12 / $columns . '">'; is_featured() ? get_template_part('templates/content', 'featured') : get_template_part('templates/content', 'masonry'); echo '</div>'; } } else { echo '<div class="col-masonry col-lg-' . 12 / $columns . '">'; is_featured() ? get_template_part('templates/content', 'featured') : get_template_part('templates/content', 'masonry'); echo '</div>'; } endwhile; echo '</div>'; echo '</div>'; }
So on my Repeater Templates, I put this short code that I thought it would have called my posts displayed in Masonry :
<div class="post-archive-masonry"> <div class="row"> <div class="col-masonry col-lg-' . 12 / $columns . '"> <?php is_featured() ? get_template_part('templates/content', 'featured') : get_template_part('templates/content', 'masonry'); ?> </div> </div> </div>
Thanks a lot for your time,
I hope to have been clear.Ruubis
- The topic ‘Problem of display with Masonry’ is closed to new replies.