Skip to content

Instantly share code, notes, and snippets.

@bearded-avenger
Created December 11, 2014 20:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bearded-avenger/998880369691b54bf220 to your computer and use it in GitHub Desktop.
Save bearded-avenger/998880369691b54bf220 to your computer and use it in GitHub Desktop.
add_shortcode('ideas','ideas_shortcode');
function ideas_shortcode(){
ob_start();
$args = array(
'post_type' => 'ideas',
'posts_per_page' => -1
);
$q = new WP_Query($args);
if($q->have_posts()) : while($q->have_posts()) : $q->the_post();
echo the_title('<h6>','</h6>');
endwhile;endif;
return ob_get_clean();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment