• Resolved s.saghian

    (@ssaghian)


    dear developers
    i want show page detail with wordpress loop & Options Framework.
    my loop without Options Framework :

    <?php
    	$my_query = new WP_Query('showposts=1&page_id=39');
    	while ($my_query->have_posts()):
    	$my_query->the_post();
    	$do_not_duplicate = $post->ID;?>		
    
            <h2>
            	<?php echo of_get_option( 'special_product', 'no entry' ); ?>
            </h2>
    
            <?php the_post_thumbnail('featuredbox'); ?>
    
    		<?php the_content(__('')); ?>
    
            <br/>
    
    <?php endwhile; ?>

    its work good & show page id 39

    my code in Options :

    $options[] = array(
    		'name' => __('Select a Page', 'options_theme'),
    		'desc' => __('Passed an pages with ID and post_title', 'options_framework_theme'),
    		'id' => 'featuredbox1',
    		'type' => 'select',
    		'options' => $options_pages);

    how can i put below code in loop:

    <?php echo of_get_option( 'featuredbox1', 'no entry' ); ?>

    https://www.ads-software.com/plugins/options-framework/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter s.saghian

    (@ssaghian)

    dear developer
    how can i use Options Framework in wordpress loop

    WeezerIsDead2Me

    (@weezerisdead2me)

    Hi, I don’t think it is clear what you’re attempting to do. Is the option set by the user on-page? You can stick it in the loop like the special-product option, but it will display the same thing, each iteration, if you have set it statically in the dashboard options page.

    hi s.saghian,

    I have encountered the same problem , Here is the solution,

    <?php
    $pageid = of_get_option('featuredbox1');
    
    $args= array(
     'page_id' => $pageid
    
    )
    
    ?>

    Sincerely,
    TONY- woorockets

    Plugin Author Devin Price

    (@downstairsdev)

    If you want to query for the selected page:

    $args = array(
    	'posts_per_page' => 1,
    	'post_type' => 'page',
    	'post__in' => array( of_get_option('featuredbox1') ),
    	'orderby' => 'post__in'
    );
    
    $query = new WP_Query( $args );
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘how can i use Options Framework in wordpress loop’ is closed to new replies.