• Resolved danstover

    (@danstover)


    Hi dc,
    From the looks of it this is a great plugin! I’m having a bit of trouble getting it set up though. I installed and activated my plugin, and set up all the settings including my repeater template.

    Then I generated a load more shortcode for use on my blog’s index page. As I only have 4 test posts so far, I was not able to see the button because WordPress’s default number of posts to display is 10. I lowered that to 3 posts to test the plugin, but instead of seeing my shortcode button at the bottom of the page, I see WordPress’s default post navigation.

    There must be something very basic that I’m doing wrong, but I’m at a loss at the moment. Any help is appreciated!

    Dan

    https://ww.wp.xz.cn/plugins/ajax-load-more/

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

    (@dcooney)

    Hi Dan,
    Sounds like Ajax Load More is not actually loading on your blog page.

    Did you replace your blog template with the shortcode?

    Thread Starter danstover

    (@danstover)

    Yes, I have this code appearing at the bottom of my index.php file in the root of my theme:

    <?php echo do_shortcode(‘[ajax_load_more post_type=”post” post_format=”standard” pause=”true” scroll=”false” button_label=”Load More Posts” button_loading_label=”Loading More Posts…”]’); ?>

    Is there another step that I am missing? For example, maybe a function that’s required on the page before that?

    Plugin Author Darren Cooney

    (@dcooney)

    Can you send me a link?

    Thread Starter danstover

    (@danstover)

    Sure,
    This is the test link:
    http://kyledavidgroup.kdgtest.com/blog/

    Plugin Author Darren Cooney

    (@dcooney)

    Your shortcode is not on that page?

    Thread Starter danstover

    (@danstover)

    It is in the template file for that page, though. It’s just not displaying (perhaps because I set the # of wordpress posts to show to only 3).Do I need to do anything else in addition to the code above that echoes the shortcode?

    Plugin Author Darren Cooney

    (@dcooney)

    WHere did you add the shortcode?
    It cannot be within your post loop.

    Thread Starter danstover

    (@danstover)

    It comes after the loop

    Plugin Author Darren Cooney

    (@dcooney)

    Please post your entire template

    Thread Starter danstover

    (@danstover)

    <?php get_header(); ?>
    
    <!--Masthead-->
    <section id="top" class="masthead">
    	<div class="container">
    		<div class="row">
    			<div class="header col-md-8 col-sm-12">
    				<h1>The Blog</h1>
    				<h4>Welcome to our blog; the place where thoughts and musings from KDG come to make themselves known. Whether business woman, volunteer coordinator, or university dean, there is something here for everyone.</h4>
    			</div><!--col-xs-12-->
    		</div><!--row-->
    	</div><!--container-->
    	<div class="color-overlay"></div>
    </section><!--masthead-->
    
    <!---Page Content-->
    <section class="blog-bar">
    	<div class="container">
    		<div class="row">
    			<div class="filter-results col-sm-3 col-xs-7">
    				<a class="dropdown-toggle" data-toggle="dropdown">Most Recent <span class="fa fa-angle-down"></span></a>
    				<ul class="dropdown-menu">
    					<?php
    						$args = array(
    							'title_li' => __(''),
    						);
    						wp_list_categories($args);
    					?>
    				</ul>
    			</div><!--col-->
    			<div class="view-all-link col-sm-3 col-xs-5">
    				<!--<a href="blog-archive.html" class="text-link">View All Posts</a>-->
    			</div><!--col-->
    
    			<div class="search-bar col-sm-offset-2 col-sm-4 col-xs-12">
    				<?php get_search_form(); ?>
    			</div><!--col-->
    		</div><!--row-->
    	</div><!--container-->
    </section>
    
    <section class="blog-roll">
    	<div class="container">
    		<div class="row">
    			<div class="col-md-10 col-md-offset-1 col-sm-12">
    				<?php if ( have_posts() ) : ?>
    
    					<?php
    					// Start the loop.
    					while ( have_posts() ) : the_post();
    						get_template_part( 'template-parts/content', get_post_format() );
    					// End the loop.
    					endwhile;
    
    					// Previous/next page navigation.
    					the_posts_pagination( array(
    						'prev_text'          => __( 'Previous page', 'kdgblog' ),
    						'next_text'          => __( 'Next page', 'kdgblog' ),
    						'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'kdgblog' ) . ' </span>',
    					) );
    
    				// If no content, include the "No posts found" template.
    				else :
    					get_template_part( 'template-parts/content', 'none' );
    
    				endif;
    				?>
    
    			</div><!--col-->
    			<div class="col-xs-12">
    				<!--<a class="kdg-btn centered">Load More Posts</a>-->
    				<?php echo do_shortcode('[ajax_load_more post_type="post" post_format="standard" pause="true" scroll="false" button_label="Load More Posts" button_loading_label="Loading More Posts..."]'); ?>
    			</div>
    		</div><!--row-->
    	</div><!--container-->
    </section>
    
    <?php get_footer(); ?>
    Plugin Author Darren Cooney

    (@dcooney)

    Ok thanks.
    Yes, the ALM JS is not being loaded. Please confirm you have wp_footer() in your footer.php file.

    Plugin Author Darren Cooney

    (@dcooney)

    As well, the CSS is not being loaded. You need wp_head() in your site headr

    Thread Starter danstover

    (@danstover)

    Thanks dcooney…I believe that is the issue. I am trying to use parent files from the root of the site for the header and the footer, so I will need to work in a way to include those. I’ll let you know if that solves the issue.

    -Dan

    Thread Starter danstover

    (@danstover)

    Ok, almost there! I found a way to put the wp_head and wp_footer functions into my header and footer appropriately. If you check that page URL again and click the button, it reloads some of the same posts. How do I prevent it from doing that? There should be 5 posts total, not 8.

    Thanks!
    Dan

    Plugin Author Darren Cooney

    (@dcooney)

    Set the offset in your shortcode to 3. offset=”3″.

Viewing 15 replies - 1 through 15 (of 16 total)

The topic ‘WordPress Default Pagination Overriding Plugin’ is closed to new replies.