Title: Pull content from a certain page
Last modified: August 21, 2016

---

# Pull content from a certain page

 *  Resolved [vince23](https://wordpress.org/support/users/vince23/)
 * (@vince23)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/pull-content-from-a-certain-page/)
 * Hey,
 * I ve got a question:
 * How can I pull the content of a certain page in my home.php (thats my theme’s
   startpage)?
 * I d like to display it at the end, shortly before the footer.
 *     ```
       <?php get_header(); ?>
   
       <?php putRevSlider( "slider" ) ?>
       	<?php the_content() ?>
       <?php get_template_part( 'page', 'index' ); ?>
   
       <div class="clear"></div>
   
       <?php
       if(siteorigin_setting('type_feature')){
       	get_template_part('features');
       }
   
       if(siteorigin_setting('type_project')){
       	pitch_display_loop(
       		siteorigin_setting('front_page_home_title_latest_projects', __('Unsere Leistungen', 'pitch')),
       		array(
       			'posts_per_page' => 10,
       			'post_type' => 'project',
       			'order_by' => 'menu_order',
       			'order' => 'ASC',
       		),
       		get_post_type_archive_link('project'),
       		'home'
       	);
       }
   
       if(siteorigin_setting('front_page_home_blog')){
       	pitch_display_loop(
       		siteorigin_setting('front_page_home_title_blog', __('From Our Blog', 'pitch')),
       		array(
       			'posts_per_page' => 10,
       			'post_type' => 'post',
       		),
       		get_post_type_archive_link('post'),
       		'home'
       	);
       }
   
       get_footer();
       ```
   

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/pull-content-from-a-certain-page/#post-3887592)
 * possibly with:
    [http://codex.wordpress.org/Function_Reference/get_page](http://codex.wordpress.org/Function_Reference/get_page)
 * or a custom query
    [http://codex.wordpress.org/Class_Reference/WP_Query](http://codex.wordpress.org/Class_Reference/WP_Query)
   [http://codex.wordpress.org/Class_Reference/WP_Query#Post_.26_Page_Parameters](http://codex.wordpress.org/Class_Reference/WP_Query#Post_.26_Page_Parameters)
 *  Thread Starter [vince23](https://wordpress.org/support/users/vince23/)
 * (@vince23)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/pull-content-from-a-certain-page/#post-3887596)
 * thanks for the answer.
 * I tried the get_page which didnt work.
 * I also have the problem that I cannot place stuffe after the if-statement. Is
   there a way to close it ?
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/pull-content-from-a-certain-page/#post-3887608)
 * >  I cannot place stuffe after the if-statement
 * this line closes the if statement:
 *     ```
       }
       ```
   
 * > I tried the get_page which didnt work.
 * any errors? no output? what was the exact code you have tried?
 *  Thread Starter [vince23](https://wordpress.org/support/users/vince23/)
 * (@vince23)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/pull-content-from-a-certain-page/#post-3887609)
 * nope, just a blank page.
 *  Thread Starter [vince23](https://wordpress.org/support/users/vince23/)
 * (@vince23)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/pull-content-from-a-certain-page/#post-3887610)
 * I tried this one:
 * `<?php get_page( 122 ) ?>`
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/pull-content-from-a-certain-page/#post-3887660)
 * did you actually read the linked Codex chapter about `get_page()` ?
 *  Thread Starter [vince23](https://wordpress.org/support/users/vince23/)
 * (@vince23)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/pull-content-from-a-certain-page/#post-3887665)
 * yep, I did.
 * Did I make a mistake in my code?
 *  [Toughbax](https://wordpress.org/support/users/toughbax/)
 * (@toughbax)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/pull-content-from-a-certain-page/#post-3887688)
 * Yes, you are using get_page incorrectly.
 * If you read the get_page codex page, at the bottom there is an example that you
   could copy almost completely and get the result your probably looking for. Just
   change the $page_id number. I even pasted it below with the number already changed.
 * Good Luck
 * [http://codex.wordpress.org/Function_Reference/get_page](http://codex.wordpress.org/Function_Reference/get_page)
 *     ```
       <?php
       $page_id = 122 ; // 122 should be replaced with a specific
       Page's id from your site, which you can find
       by mousing over the link to edit that Page
       on the Manage Pages admin page. The id will
       be embedded in the query string of the URL,
       e.g. page.php?action=edit&post=122 .
   
       $page_data = get_page( $page_id ); // You must pass in a
       variable to the get_page function. If you pass in a value
       (e.g. get_page ( 122 ); ), WordPress will generate an
       error. By default, this will return an object.
   
       echo '<h3>'. $page_data->post_title .'</h3>';// echo the title
   
       echo apply_filters('the_content', $page_data->post_content); // echo
        the content and retain WordPress filters such as paragraph tags.
   
       Origin:
       http://wordpress.org/support/topic/get_pagepost-and-no-paragraphs-problem
       ?>
       ```
   
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/pull-content-from-a-certain-page/#post-3887691)
 * your code is not very complete and does not really follow the example given in
   the Codex chapter;
 * try:
 *     ```
       <?php $page_id = 122;
       $page_data = get_page( $page_id );
       echo apply_filters('the_content', $page_data->post_content);
       ?>
       ```
   
 *  Thread Starter [vince23](https://wordpress.org/support/users/vince23/)
 * (@vince23)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/pull-content-from-a-certain-page/#post-3887716)
 * Thank you guys so much, thats it !!

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

The topic ‘Pull content from a certain page’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 10 replies
 * 3 participants
 * Last reply from: [vince23](https://wordpress.org/support/users/vince23/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/pull-content-from-a-certain-page/#post-3887716)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
