Created
July 21, 2018 20:43
-
-
Save DmitriyRF/2fecf5727f61529934369e0406cbb497 to your computer and use it in GitHub Desktop.
Query for custom post type, wordpress, Query,
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
get_header(); | |
$the_query = new WP_Query( array( 'post_type' => 'posttype' ) ); | |
// The Loop | |
if ( $the_query->have_posts() ) { | |
while ( $the_query->have_posts() ) { | |
$the_query->the_post(); | |
the_title(); | |
// the_post_thumbnail(); | |
the_post_thumbnail_url(); | |
$mg_data = get_post_meta( $post->ID, 'posttype_meta_keys', true ); | |
print_r($mg_data); | |
} | |
wp_reset_query(); | |
} else { | |
echo 'No managers'; | |
} | |
get_footer(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment