• Hi,

    Plugin doesn’t seem to work correctly, the load more button works but it simply repeats the first four posts over and over. My blog is highly customised in terms of CSS I have to run a query inside the theme repeater template. Any ideas?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi @digstertron the plugin doesn’t know about these other posts. Try setting ‘offset=“4”’ in your shortcode.

    Hope that helps.

    • This reply was modified 1 year, 11 months ago by Darren Cooney.
    Thread Starter digstertron

    (@digstertron)

    Thanks I’ll give it a go. There are twenty posts in total.

    Thread Starter digstertron

    (@digstertron)

    It doesn’t work it simply repeats the first four posts from my Blog.

    Plugin Author Darren Cooney

    (@dcooney)

    Offset is you instruct the plugin to skip the first x number of posts in the Ajax query.
    Please share your entire shortcode.

    Thread Starter digstertron

    (@digstertron)

    What about the WP Admin settings? What should that set to show posts per page I mean? Here is my short code:

    ‘[ajax_load_more container_type=”div” post_type=”post, page, attachment, any” posts_per_page=”4″ offset=”4″ pause=”true”]’

    Plugin Author Darren Cooney

    (@dcooney)

    Are you wanting to show all your post types here? Usually it would be post_type=“post”

    you’re probably offsetting more then just posts which would be displayed on your blog page.

    Thread Starter digstertron

    (@digstertron)

    All I want to achieve is for the my post to load chronologically as the user clicks the load more button. I am wanting to show all my posts within my Blog page. Thanks for your help. What should I do next?

    Thread Starter digstertron

    (@digstertron)

    I was about to post my full code but it’s not letting me post it up here.

    • This reply was modified 1 year, 11 months ago by digstertron.
    Plugin Author Darren Cooney

    (@dcooney)

    Change what post types are being displayed.

    Look at your current shortcode.

    post_type=”post, page, attachment, any”

    Thread Starter digstertron

    (@digstertron)

    Here is my new code, problem persists:

    <?php echo do_shortcode('[ajax_load_more container_type="div" post_type="post" posts_per_page="4" offset="4" pause="true" scroll="false" button_loading_label="Loading posts"]'); ?>
    Thread Starter digstertron

    (@digstertron)

    Here is my template code:

    <?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>


    • This reply was modified 1 year, 11 months ago by digstertron.
    Plugin Author Darren Cooney

    (@dcooney)

    Ok your template is the problem.

    Start by reading the quick documentation aand on Repeater Templates and the plugin works.

    Ajax Load More creates a query for you and you do not add a query to a repeater template.

    Note: your shortcode looks great now, just fix up the template.

    • This reply was modified 1 year, 11 months ago by Darren Cooney.
    Thread Starter digstertron

    (@digstertron)

    Thanks. That’s the part I’m struggling with! I’ll have a look at those articles.

    Thread Starter digstertron

    (@digstertron)

    Just thought I’d let you know I managed to add my custom CSS classes to the default template I had to make a slight adjustment to the main container so now it displays in grid format. Problem solved! All the best.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Duplicate posts.’ is closed to new replies.