Title: Code Placement
Last modified: August 22, 2016

---

# Code Placement

 *  [hydardewachi](https://wordpress.org/support/users/hydardewachi/)
 * (@hydardewachi)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/code-placement-1/)
 * Hi..
 * I just installed the plugin but can’t seem to get it to work.
 * I have set up an example tag page and placed the code as suggested but all posts
   get loaded and the “load more” button appears at end of the page and disabled.
 * The theme I use has pagination option and the load more doesn’t seem to work 
   regardless of the number of posts I set it to show per page. so if I set post
   per page to 20, the page loads 20 and load more is still disabled.
 * Can you please advise on how to configure the code and the paging settings?
 * Your help and support is much appreciated.
 * Here is a link to the example tag page: [http://www.hydardewachi.com/tag/photography/](http://www.hydardewachi.com/tag/photography/)
 * Theme: [http://www.wpexplorer.com/pronto-wordpress-theme/](http://www.wpexplorer.com/pronto-wordpress-theme/)
 * and here is the code:
 *     ```
       <div id="primary" class="content-area clr">
       		<div id="content" class="site-content" role="main">
       		<?php if ( have_posts() ) : ?>
       			<div id="infinite-wrap" class="grid clr">
       				<?php while ( have_posts() ) : the_post(); ?>
       					<?php get_template_part( 'content', get_post_format() ); ?>
       				<?php endwhile; ?>
           		</div><!-- .grid -->
                               <?php
       			$tag = get_query_var('tag');
       			echo do_shortcode('[ajax_load_more tag="'.$tag.'"]');
       			?>
       			<?php wpex_pagination(); ?>
       		<?php else : ?>
       			<?php get_template_part( 'content', 'none' ); ?>
       		<?php endif; ?>
       		</div><!-- #content -->
       	</div><!-- #primary -->
       ```
   
 * [https://wordpress.org/plugins/ajax-load-more/](https://wordpress.org/plugins/ajax-load-more/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/code-placement-1/#post-5719257)
 * What does your repeater look like?
 *  Thread Starter [hydardewachi](https://wordpress.org/support/users/hydardewachi/)
 * (@hydardewachi)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/code-placement-1/#post-5719259)
 * thanks.. yes, sorry, missed that one, here it is:
 *     ```
       <div><?php if ( has_post_thumbnail() && get_theme_mod( 'wpex_blog_entry_thumb', '1' ) == '1' ) { ?>
       			<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark" class="loop-entry-img-link">
       				<img src="<?php echo aq_resize( wp_get_attachment_url( get_post_thumbnail_id() ), wpex_img('blog_entry_width'),  wpex_img('blog_entry_height'),  wpex_img('blog_entry_crop') ) ?>" alt="<?php echo the_title(); ?>" />
       			</a>
       		<?php } ?>
       		<div class="loop-entry-details">
       			<header><h2><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2></header>
       			<div class="loop-entry-excerpt">
       				<?php the_excerpt(); ?>
       			</div><!-- .loop-entry-excerpt -->
       		</div><!-- .loop-entry-details -->
       </div>
       ```
   
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/code-placement-1/#post-5719263)
 * I think there is an issue with one of the function calls in your repeater.
    You
   can see in this screenshot [http://cl.ly/image/0O0a1S2q1Y0r](http://cl.ly/image/0O0a1S2q1Y0r)
   the load more just stops at the first anchor tag.
 * I’m thinking the aq_resize() is the issue. Im not sure why it wouldnt be working
   but if that function is from another plugin it might not be available with the
   ajax call.
 *  Thread Starter [hydardewachi](https://wordpress.org/support/users/hydardewachi/)
 * (@hydardewachi)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/code-placement-1/#post-5719267)
 * I copied the repeated code from my theme content.php code.
 * If I use the default repeater, what should be the pagination settings to use 
   on WordPress? Do I set items per page to max number or the same items as per 
   the ALM? And do I comment out the pagination code in the Category/ Tag page?
 * Thanks ever so much for your help..
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/code-placement-1/#post-5719270)
 * Ajax Load More would replace everything in your cat/tag page. it handles the 
   paging.
 *  Thread Starter [hydardewachi](https://wordpress.org/support/users/hydardewachi/)
 * (@hydardewachi)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/code-placement-1/#post-5719274)
 * I changed the repeater to the below and now I get the items listed underneath
   the original one from the theme.
    see here: [http://www.hydardewachi.com/tag/photography/](http://www.hydardewachi.com/tag/photography/)
 * Repeater:
 *     ```
       <div class="loop-entry-details">
       			<header><h2><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2></header>
       			<div class="loop-entry-excerpt">
       				<?php the_excerpt(); ?>
       			</div><!-- .loop-entry-excerpt -->
       		</div><!-- .loop-entry-details -->
       ```
   
 *  Thread Starter [hydardewachi](https://wordpress.org/support/users/hydardewachi/)
 * (@hydardewachi)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/code-placement-1/#post-5719293)
 * Thanks for your help so far..
 * Do you think you can help with this issue or is there a paid Pro version with
   more support or shall I give up on the plug-in?
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/code-placement-1/#post-5719317)
 * Yes, you need to edit your archive templates and remove the other code.
 * Email me darren.cooney[at]gmail if you need help with the templates.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Code Placement’ is closed to new replies.

 * ![](https://ps.w.org/ajax-load-more/assets/icon-256x256.png?rev=2944639)
 * [Ajax Load More – Infinite Scroll, Load More, & Lazy Load](https://wordpress.org/plugins/ajax-load-more/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-load-more/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-load-more/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-load-more/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-load-more/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-load-more/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/code-placement-1/#post-5719317)
 * Status: not resolved