Title: loading the sidebar
Last modified: October 23, 2017

---

# loading the sidebar

 *  Resolved [gatta2](https://wordpress.org/support/users/gatta2/)
 * (@gatta2)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/loading-the-sidebar/)
 * I’m using a child theme of the twentytwelve theme and I added the shortcode to
   the single.php file. The ajax load content is only the main content though. How
   do I make the sidebar which is on the right to also be in the ajax load content?

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

 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/loading-the-sidebar/#post-9616891)
 * Hi [@gatta2](https://wordpress.org/support/users/gatta2/),
    I’m not sure how 
   twentytwelve works but it likely needs to be added to the sidebar widget zone.
 * Hope that helps.
 *  Thread Starter [gatta2](https://wordpress.org/support/users/gatta2/)
 * (@gatta2)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/loading-the-sidebar/#post-9617155)
 * Do you mean having 2 [ajax_load_more] shortcode on the same page one for the 
   main content, the other for the sidebar? Then 2 different repeater templates 
   will be needed.
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/loading-the-sidebar/#post-9617184)
 * I misunderstood your question. My bad.
 * If you want sidebar content as well as main content you would just need to include
   that code in your repeater template.
 * Unfortunately, the way twenty twelve is constructed but it would require customizing
   the single.php template and moving around some HTML elements to get the sidebar
   inside the `while ( have_posts())` loop.
 * Here is the single.php with things moved around… You could then construct a repeater
   template out of the content between the while loop.
 *     ```
       <?php
       /**
        * The Template for displaying all single posts
        *
        * @package WordPress
        * @subpackage Twenty_Twelve
        * @since Twenty Twelve 1.0
        */
   
       get_header(); ?>
   
       <div class="alm-wrapper">
   
       	<?php while ( have_posts() ) : the_post(); ?>
   
       		<div id="primary" class="site-content">
       			<div id="content" role="main">
   
   
   
       					<?php get_template_part( 'content', get_post_format() ); ?>
   
       					<nav class="nav-single">
       						<h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
       						<span class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'twentytwelve' ) . '</span> %title' ); ?></span>
       						<span class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentytwelve' ) . '</span>' ); ?></span>
       					</nav><!-- .nav-single -->
   
       					<?php comments_template( '', true ); ?>			
   
       			</div><!-- #content -->
       		</div><!-- #primary -->
       		<?php get_sidebar(); ?>
   
       	<?php endwhile; // end of the loop. ?>
   
       </div>
       <!-- .alm-wrapper -->
   
       <?php get_footer(); ?>
       ```
   
 *  Thread Starter [gatta2](https://wordpress.org/support/users/gatta2/)
 * (@gatta2)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/loading-the-sidebar/#post-9687126)
 * In the above single.php, where do I put the [ajax_load_more] short code?
 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/loading-the-sidebar/#post-9689651)
 * For the sidebar?
    In your sidebar.php template. `get_sidebar()`

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

The topic ‘loading the sidebar’ 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/)

 * 5 replies
 * 2 participants
 * Last reply from: [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/loading-the-sidebar/#post-9689651)
 * Status: resolved