Support

Account

Home Forums General Issues Issue with WP meta query Reply To: Issue with WP meta query

  • Hi,

    You can use the following codes as well,

    <?php
    $posts = get_posts(array(
    	'numberposts' => 2,
    	'post_type' => 'ctas',
    	'meta_key' => 'cta_location',
            'meta_value' => 'about'
    ));  
    ?>
     
    foreach ( $posts as $post ) : setup_postdata( $post ); ?>
            <div class="widget">
    	     <?php the_content(); ?>
    	</div>
    <?php endforeach; wp_reset_postdata();?>

    I hope that helps,