Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

how to pull data from a page into this themes home page WordPress


Hi - I bought this really cool theme but I want to replace the home page portfolio slider (which is showing the image slide show of "Featured Work") with the content from a page(preferred) or post.

here is a copy of index.php

I know that it has something to do with replacing the
<?php include (TEMPLATEPATH . "/lib/includes/portfolioSlider.php"); ?> below, but I don't know that to replace it with to pull in x page or post.


<?php get_header(); ?>

<div id="article-content">

<?php if (get_option('phi_slideshow')== 'cycle'){

include (TEMPLATEPATH . "/lib/includes/slideshow.php");


elseif (get_option('phi_slideshow')== 'accordion'){

include (TEMPLATEPATH . "/lib/includes/accordion.php");



<div id="pagetitle">


$querystr = "

SELECT wposts.*

FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta

WHERE wposts.ID = wpostmeta.post_id

AND wpostmeta.meta_key = 'phi_featured_page'

AND wposts.post_status = 'publish'

AND wposts.post_type = 'page'

ORDER BY wposts.menu_order asc


$pageposts = $wpdb->get_results($querystr, OBJECT);



<div id="featured-menu">

<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Page Title Widget')){};?>



<?php $sidebarposition = get_option('phi_sidebarposition'); ?>

<div id="content" class="content-<?php echo $sidebarposition;?>">

<?php get_sidebar();?>

<div class="content-narrow contentwidth slider">

<?php include (TEMPLATEPATH . "/lib/includes/portfolioSlider.php"); ?>





<?php get_footer();?>

Answers (4)


Nilesh shiragave answers:

you just want text content of the page or also you want title?

Chris John comments:

Nilesh - thanks for looking at it, but I wasn't getting responses so I found a solution elsewhere.
Thanks anyway...


Baki Goxhaj answers:

You want the content of a single page/post or a set of them?


Pali Madra answers:


What is the type of content that you intend to pull in. Is it text, images or other media.

Once you have clarified I will be in a better position to give you the best option that you can use.


Ramsey answers:

Try this:

$post_id = 26;
$queried_post = get_post($post_id);
<h2><?php echo $queried_post->post_title; ?></h2>
<?php echo $queried_post->post_content; ?>

Of course replacing the post_id with the post you're wanting to display. If you're wanting to grab page content try this:

<?php query_posts('page_id=1');
if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php echo the_content('Continue reading ยป'); endwhile; ?>
<?php endif; ?>