Skip to content

Instantly share code, notes, and snippets.

@titus-shoats
Last active November 10, 2016 01:43
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 titus-shoats/8402113b26fd447fa8e0 to your computer and use it in GitHub Desktop.
Save titus-shoats/8402113b26fd447fa8e0 to your computer and use it in GitHub Desktop.
display custom post types
<?php
$args = array(
'post_type'=>'products'
);
$myproducts = new WP_Query($args);
while($myproducts->have_posts()) : $myproducts->the_post();
?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php
endwhile;
wp_reset_postdata();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment