Title: Loader with variable div, page ID
Last modified: August 22, 2016

---

# Loader with variable div, page ID

 *  [koreill1](https://wordpress.org/support/users/koreill1/)
 * (@koreill1)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/loader-with-variable-div-page-id/)
 * Hi, I’ve provided the div that wraps my post content, below, from my theme’s 
   page.php file. What would I put in the Advanced Ajax Setting’s Content Element
   ID field for the following? The div id seems to be: div id=”page-<?php the_ID();?
   >”
 *     ```
       <?php
       		/////////////////////////////////////////////
       		// PAGE
       		/////////////////////////////////////////////
       		?>
       		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
       			<div id="page-<?php the_ID(); ?>" class="type-page" itemscope itemtype="http://schema.org/Article">
   
       			<!-- page-title -->
       			<?php if($themify->page_title != "yes"): ?>
       				<h1 class="page-title" itemprop="name"><?php the_title(); ?></h1>
       			<?php endif; ?>
       			<!-- /page-title -->
   
       			<div class="page-content entry-content" itemprop="articleBody">
   
       				<?php the_content(); ?>
       ```
   
 * [https://wordpress.org/plugins/advanced-ajax-page-loader/](https://wordpress.org/plugins/advanced-ajax-page-loader/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [koreill1](https://wordpress.org/support/users/koreill1/)
 * (@koreill1)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/loader-with-variable-div-page-id/#post-5915892)
 * I realized that I should be using my index.php file. The loader is still stuck,
   however. When I click “Older posts” the loading graphic just spins forever without
   loading the next post. The URL is changed though to the URL of the older post.
 * Can anyone tell me what Content Element ID I should be using? My code index.php
   code is below:
 *     ```
       <?php
       /** Themify Default Variables
        *  @var object */
       global $themify; ?>
   
       <!-- layout-container -->
       <div id="layout" class="clearfix">
   
       	<?php themify_content_before(); //hook ?>
       	<!-- content -->
       	<div id="content" class="clearfix">
           	<?php themify_content_start(); //hook ?>
   
       		<?php
       		/////////////////////////////////////////////
       		// Author Page
       		/////////////////////////////////////////////
       		?>
       		<?php if(is_author()) : ?>
       			<?php
       			$curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
       			$author_url = $curauth->user_url;
       			?>
       			<div class="author-bio clearfix">
       				<p class="author-avatar"><?php echo get_avatar( $curauth->user_email, $size = '48' ); ?></p>
       				<h2 class="author-name"><?php _e('About','themify'); ?> <?php echo $curauth->first_name; ?> <?php echo $curauth->last_name; ?></h2>
       				<?php if($author_url != ''): ?><p class="author-url"><a href="<?php echo $author_url; ?>"><?php echo $author_url; ?></a></p><?php endif; //author url ?>
       				<div class="author-description">
       					<?php echo $curauth->user_description; ?>
       				</div>
       				<!-- /.author-description -->
       			</div>
       			<!-- /.author bio -->
   
       			<h2 class="author-posts-by"><?php _e('Posts by','themify'); ?> <?php echo $curauth->first_name; ?> <?php echo $curauth->last_name; ?>:</h2>
       		<?php endif; ?>
   
       		<?php
       		/////////////////////////////////////////////
       		// Search Title
       		/////////////////////////////////////////////
       		?>
       		<?php if(is_search()): ?>
       			<h1 class="page-title"><?php _e('Search Results for:','themify'); ?> <em><?php echo get_search_query(); ?></em></h1>
       		<?php endif; ?>
   
       		<?php
       		/////////////////////////////////////////////
       		// Date Archive Title
       		/////////////////////////////////////////////
       		?>
       		<?php if ( is_day() ) : ?>
       			<h1 class="page-title"><?php printf( __( 'Daily Archives: <span>%s</span>', 'themify' ), get_the_date() ); ?></h1>
       		<?php elseif ( is_month() ) : ?>
       			<h1 class="page-title"><?php printf( __( 'Monthly Archives: <span>%s</span>', 'themify' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'themify' ) ) ); ?></h1>
       		<?php elseif ( is_year() ) : ?>
       			<h1 class="page-title"><?php printf( __( 'Yearly Archives: <span>%s</span>', 'themify' ), get_the_date( _x( 'Y', 'yearly archives date format', 'themify' ) ) ); ?></h1>
       		<?php endif; ?>
   
       		<?php
       		/////////////////////////////////////////////
       		// Category Title
       		/////////////////////////////////////////////
       		?>
       		<?php if(is_category() || is_tag() || is_tax() ): ?>
       			<h1 class="page-title"><?php single_cat_title(); ?></h1>
       			<?php echo $themify->get_category_description(); ?>
       		<?php endif; ?>
   
       		<?php
       		/////////////////////////////////////////////
       		// Default query categories
       		/////////////////////////////////////////////
       		?>
       		<?php if( !is_search() ): ?>
       			<?php
       			global $query_string;
       			query_posts( apply_filters( 'themify_query_posts_args', $query_string.'&order='.$themify->order.'&orderby='.$themify->orderby ) );
       			?>
       		<?php endif; ?>
   
       		<?php
       		/////////////////////////////////////////////
       		// Loop
       		/////////////////////////////////////////////
       		?>
   
       		<?php if (have_posts()) : ?>
   
       			<!-- loops-wrapper -->
       			<div id="loops-wrapper" class="loops-wrapper <?php echo $themify->layout . ' ' . $themify->post_layout; ?>">
   
       				<?php while (have_posts()) : the_post(); ?>
   
       					<?php if(is_search()): ?>
       						<?php get_template_part( 'includes/loop','search'); ?>
       					<?php else: ?>
       						<?php get_template_part( 'includes/loop','index'); ?>
       					<?php endif; ?>
   
       				<?php endwhile; ?>
   
       			</div>
       			<!-- /loops-wrapper -->
   
       			<?php get_template_part( 'includes/pagination'); ?>
   
       		<?php
       		/////////////////////////////////////////////
       		// Error - No Page Found
       		/////////////////////////////////////////////
       		?>
   
       		<?php else : ?>
   
       			<p><?php _e( 'Sorry, nothing found.', 'themify' ); ?></p>
   
       		<?php endif; ?>			
   
       		<?php themify_content_end(); //hook ?>
       	</div>
       	<!-- /content -->
           <?php themify_content_after() //hook; ?>
   
       	<?php
       	/////////////////////////////////////////////
       	// Sidebar
       	/////////////////////////////////////////////
       	if ($themify->layout != "sidebar-none"): get_sidebar(); endif; ?>
   
       </div>
       <!-- /layout-container -->
   
       <?php get_footer(); ?>
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Loader with variable div, page ID’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/advanced-ajax-page-loader_bcd4a4.
   svg)
 * [Advanced AJAX Page Loader](https://wordpress.org/plugins/advanced-ajax-page-loader/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-ajax-page-loader/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-ajax-page-loader/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-ajax-page-loader/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-ajax-page-loader/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-ajax-page-loader/reviews/)

## Tags

 * [ajax](https://wordpress.org/support/topic-tag/ajax/)
 * [div](https://wordpress.org/support/topic-tag/div/)

 * 1 reply
 * 1 participant
 * Last reply from: [koreill1](https://wordpress.org/support/users/koreill1/)
 * Last activity: [11 years, 1 month ago](https://wordpress.org/support/topic/loader-with-variable-div-page-id/#post-5915892)
 * Status: not resolved