Query Page Content From Theme Options?

I’m trying to create a slider where you choose what pages are shown in the slider, using a theme options panel based on the https://github.com/vauvarin/options-framework-theme

That lists the pages in the options like so..

Read More
<?php
$options[] = array( "name" => "Slider One Page",
                                        "desc" => "Choose page for first slide.",
                                        "id" => "slide_page1",
                                        "type" => "select",
                                        "options" => $options_pages);
?>

To display that page id in the theme page i use..

<?php echo of_get_option('slide_page1'); ?>

So how do in corporate that page id into a query to display the pages content?

Is it possible?

Thanks for any help.

Related posts

Leave a Reply

1 comment

  1. Figured it out myself, for anyone else that needs help here are the two options..

                <!--Method 1-->
    
            <?php $query = new WP_Query(); $query->query('post_type=page&p=' . of_get_option('slide_page1'));while ($query->have_posts()) : $query->the_post(); ?>
    
            <?php the_title(); ?>
    
            <?php endwhile; wp_reset_query(); ?>        
    
            <!--Method 2-->
    
                <?php $slide1 = of_get_option('slide_page1');?>
    
            <?php $loop = new WP_Query( array('p' => $slide1, 'post_type' => array('post', 'page'), )); ?>
    
            <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
    
            <h3>    <?php the_title(); ?></h3>
    
            <?php endwhile; wp_reset_query(); ?>