• Resolved gatta2

    (@gatta2)


    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

    (@dcooney)

    Hi @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

    (@gatta2)

    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

    (@dcooney)

    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

    (@gatta2)

    In the above single.php, where do I put the [ajax_load_more] short code?

    Plugin Author Darren Cooney

    (@dcooney)

    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.