Support » Plugin: OptionTree » [Plugin: OptionTree] Choose a page (if don't, not display)

  • Resolved brightweb1

    (@brightweb1)


    Hello.

    I found your framework a few days ago and am loving it!

    But I have little doubt…

    If I choose a page, the system displays the contents. But if I don’t choose any page, it shows the default loop (with posts). Is there a way to set up to display none?

    The code:

    <?php $recent = new WP_Query('page_id='.get_option_tree( 'test_input' )); while($recent->have_posts()) : $recent->the_post();?>
                <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail( 'home-info' ); ?></a>
                <?php the_excerpt(); ?>
                <?php endwhile; ?>
                <div class="learnmore">
                    <a href="<?php the_permalink() ?>" rel="bookmark">Learn More</a>
                </div>

    Thanks!

    http://wordpress.org/extend/plugins/option-tree/

Viewing 1 replies (of 1 total)
  • Plugin Author Derek Herman

    (@valendesigns)

    First of all save the data to a variable, don’t just add it directly to the page_id. Then if there is nothing set don’t loop through the pages.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: OptionTree] Choose a page (if don't, not display)’ is closed to new replies.