Advertisement
iamdangavin

WP Alchemy Meta Loop

Apr 5th, 2012
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. <?php $mb->the_field('video_featured'); ?>
  2. <input type="checkbox" name="<?php $metabox->the_name(); ?>" value="featured"<?php if ($metabox->get_the_value()) echo ' checked="checked"'; ?>/>
  3.  
  4. <?php
  5. global $scout_video_featured;
  6.     $args = array(
  7.     'post_type' => 'scout_video_cpt',
  8.     // must use meta_query as an array with WP 3.1+ (instead of meta_key or meta_value)
  9.     'meta_query' => array(
  10.         array(
  11.         // only works if 'mode' => WPALCHEMY_MODE_EXTRACT is used for $custom_metabox in functions.php
  12.         'key' => $scout_video_featured->get_the_name('video_featured'),
  13.         'value' => 'featured',
  14.         'compare' => 'LIKE'
  15.         )
  16.     )
  17.     );
  18. $slides = new WP_Query($args);
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement