Skip to content

Instantly share code, notes, and snippets.

@matheuswd
Created November 15, 2015 13:19
Show Gist options
  • Save matheuswd/2b769c07f53b91d9ee7d to your computer and use it in GitHub Desktop.
Save matheuswd/2b769c07f53b91d9ee7d to your computer and use it in GitHub Desktop.
How to get a custom value from a Custom Post Type
<?php $get_custom_value = new WP_Query( array( 'post_type' => 'yourposttypehere', 'posts_per_page' => -1 ) ); ?>
<?php while ( $get_custom_value->have_posts() ) : $get_custom_value->the_post(); ?>
<!-- The stuff you want to loop goes in here -->
<?php endwhile; wp_reset_query(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment