• Resolved digstertron

    (@digstertron)


    Hi. I’ve managed to configure the default.php template it works however it’s repeating existing posts over and over. Can you help please? Thanks

    • This topic was modified 1 year, 1 month ago by digstertron.
Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hello @digstertron Sure, but I need more information to be able to even guess what the issue is.

    • Can you share a link?
    • Can you share your Repeater Template?
    Thread Starter digstertron

    (@digstertron)

    Hi, this is my code inside the default.php template file:


    <?php $_posts = new WP_Query($args);?>

    <main class=”fullwidth-blog”>

    <div class=”bloglist”>

    <?php while($_posts->have_posts()): $_posts->the_post();?>

    <div class=”blog_list_outter”>

    <div class=”post-grid”>

    <h2 class=”blog_heading”>

    <a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a>

    </h2>

    </div>

    <div class=”blog_author”>

    <div class=”author_image”><?php echo get_avatar( get_the_author_meta(‘ID’), 60); ?></div>

    <div class=”author-profile-post”><?php the_author_posts_link();?></div>

    </div>

    <div class=”category_title”>

    <div class=”category__list__card”>

    <p class=”cat”>

    <?php the_category(‘, ‘); ?>

    </p>

    </div>

    <div class=”post__stamp”>

    <?php the_time(‘F j, Y’); ?>

    </div>

    </div>

    </div>

    <?php endwhile; ?>

    </div>

    </main>

    Plugin Author Darren Cooney

    (@dcooney)

    Ok this is incorrect.

    Here are a few docs to get started with the plugin.

    Ajax Load More creates a query for you, so you need to remove that remove your Repeater Template.

    Plugin Author Darren Cooney

    (@dcooney)

    Your Repeater Template would be what’s between the while and endwhile in that template.

    Thread Starter digstertron

    (@digstertron)

    If I remove the query the posts do not load and I have been through the documentation and followed the steps so I’m really at a total loss.

    Plugin Author Darren Cooney

    (@dcooney)

    That’s how the plugin works and you’re using it incorrectly.

    Please revert your Repeater Template to the default.
    https://connekthq.com/plugins/ajax-load-more/docs/faqs/#how-can-i-restore-the-default-repeater-template

    Create a new page and drop the basic Ajax Load More shortcode onto it using the shortcode block.

    [ajax_load_more]

    Thread Starter digstertron

    (@digstertron)

    The problem with using the default code is I am using custom CSS for my Blog layout. The basic repeater template code works but visually it’s not matching my theme.

    Plugin Author Darren Cooney

    (@dcooney)

    Yes I know. You said “If I remove the query the posts do not load“.
    Im asking you test the default to see if anything loads.

    Thread Starter digstertron

    (@digstertron)

    The default template works perfectly but when I apply custom CSS rules they are not being honoured specifically – .alm-listing .alm-reveal behaves of its own accord. My blog posts are displayed within a two column grid which Ajax is ignoring for the custom generated posts.

    Plugin Author Darren Cooney

    (@dcooney)

    [ajax_load_more css_classes="fullwidth-blog" transition_container_classes="bloglist"]

    Thread Starter digstertron

    (@digstertron)

    Apologies I realised I hadn’t set the transition container correctly. Sorry for the back and forth and many thanks for your help.

    Thread Starter digstertron

    (@digstertron)

    Thanks again 🙂

    Plugin Author Darren Cooney

    (@dcooney)

    No worries. Sounds like it’s working… happy to hear that!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Duplicate Posts – default.php’ is closed to new replies.