Title: Pages displaying same content
Last modified: August 21, 2016

---

# Pages displaying same content

 *  [Scott B.](https://wordpress.org/support/users/scott-b-1/)
 * (@scott-b-1)
 * [13 years ago](https://wordpress.org/support/topic/pages-displaying-same-content/)
 * I’m use this template file it displays the same content on the pages that use
   the file. I’m didn’t write the code and am fairly new to PHP. Can someone please
   tell me what I need to remove or add in order to make this work.
 *     ```
       <?php
       /**
        * Template Name: OurWork Internal Pages
        */
   
       get_header(); ?>
       <div id="content">
       			<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
       	        <article class="post clearfix">
                   <header>
                   <h1 class="blog-title">Our Work</h1>
                   </header>
   
                   <?php
                   $child_pages = $wpdb->get_results("SELECT *    FROM $wpdb->posts WHERE post_parent = ".$post->post_parent."    AND post_type = 'page' ORDER BY menu_order", 'OBJECT');    ?>
                   <?php if ( $child_pages ){?>
                   <ul class="child-pages">
       			<?php foreach ( $child_pages as $pageChild ) : setup_postdata( $pageChild );
       			$class= "";
       			if($pageChild->ID==$post->ID)
       				$class = "class='current-menu-item-parent'";
       			else
       				$class = "";
       			?>
                   <li <?php echo $class;?>>
                   <?php echo get_the_post_thumbnail($page->ID, 'thumbnail'); ?>
                   <?php
       				$title = $pageChild->post_title;
       			?>
                   <a href="<?php echo  get_permalink($pageChild->ID); ?>" rel="bookmark" title="<?php echo $pageChild->post_title; ?>"><?php echo $title; ?></a>
                   </li>
                   <?php endforeach;?>
                   </ul>
                   <div class="clear"></div>
   
                   <?php }?>
   
                   <h1 class="page-title"><?php the_title();?></h1>
                   <?php the_content(); ?>
                   </article>
           	        <!-- /.post -->
       			<?php endwhile?>
                   <div class="clearfix"></div>
       </div>
       <!-- /#content -->
       <?php get_sidebar(); ?>
       <?php get_footer(); ?>
       ```
   
 * I would really appreciate any help.
 * Thanks,
    Scott

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

 *  [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [13 years ago](https://wordpress.org/support/topic/pages-displaying-same-content/#post-3694315)
 * What (in human terms) are you wanting to display with this template file?
 *  Thread Starter [Scott B.](https://wordpress.org/support/users/scott-b-1/)
 * (@scott-b-1)
 * [13 years ago](https://wordpress.org/support/topic/pages-displaying-same-content/#post-3694318)
 * content from posts. the problem is it displays the same content on all new pages
   that use the template. The only thing that changes is the title.
 *  [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * (@chipbennett)
 * [13 years ago](https://wordpress.org/support/topic/pages-displaying-same-content/#post-3694319)
 * > content from posts
 * Content from _what specific_ posts?

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

The topic ‘Pages displaying same content’ is closed to new replies.

 * 3 replies
 * 2 participants
 * Last reply from: [Chip Bennett](https://wordpress.org/support/users/chipbennett/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/pages-displaying-same-content/#post-3694319)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
