Title: PHP Code to Display Certain Pages
Last modified: September 1, 2016

---

# PHP Code to Display Certain Pages

 *  [pledgerar](https://wordpress.org/support/users/pledgerar/)
 * (@pledgerar)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/php-code-to-display-certain-pages/)
 * My domain name is [link](http://aokpropertypreservation.com/) and as you can 
   see, there are three duplicate blocks displaying pages displayed in the top rows.
   I have pasted what I think is the responsible php block
 *     ```
       <section id="wrapsecond" class="pagewrap2">
                   	<div class="container">
                           <div class="services-wrap">
   
                             <?php for($p=1; $p<7; $p++) { $q = $p; if($p>3) $q -=3; ?>
   
               	<?php if( get_theme_mod('page-column'.$q,false)) { ?>
               		<?php $queryxxx = new WP_query('page_id='.get_theme_mod('page-column'.$q,true)); ?>
       						<?php while( $queryxxx->have_posts() ) : $queryxxx->the_post(); ?>
                               <div class="listpages <?php if($p % 3 == 0) { echo "last_column"; } ?>">
       						<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail();?>
       						<h4><?php the_title(); ?></h4></a>
       						<?php /* <p><?php the_excerpt(); ?></p>
                               <a href="<?php the_permalink(); ?>"><?php _e('Read More','skt-construction'); ?></a> */ ?>
                               </div>
       						<?php endwhile;
       						wp_reset_query(); ?>
                   <?php } else { ?>
       					<div class="listpages <?php if($p % 3 == 0) { echo "last_column"; } ?>">
                               <a href=""><img src="<?php echo get_template_directory_uri(); ?>/images/about<?php echo $p; ?>.jpg" alt="" />
       						<h4><?php _e('Page Title','skt-construction'); ?> <?php echo $p; ?></h4></a>
       						<p><?php _e('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque augue eros, posuere a condimentum sit amet, rhoncus eu libero. Maecenas in tincidunt turpis, ut rhoncus neque.','skt-construction'); ?></p>
                               <a href="#"><?php _e('Read More','skt-construction'); ?></a>
                               </div>
       			<?php }} ?>
   
                      </div><!-- services-wrap-->
       ```
   

The topic ‘PHP Code to Display Certain Pages’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [Theme modification](https://wordpress.org/support/topic-tag/theme-modification/)

 * 0 replies
 * 1 participant
 * Last reply from: [pledgerar](https://wordpress.org/support/users/pledgerar/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/php-code-to-display-certain-pages/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
