Last active
August 29, 2015 14:16
-
-
Save romuloctba/a4795daf301ce5b96284 to your computer and use it in GitHub Desktop.
Custom Wordpress Loop with custom fields from types plugin
This file contains hidden or 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 | |
$args = array( | |
'post_type' => 'post-slug', | |
'posts_per_page' => 6 | |
); | |
$loop = new WP_Query( $args ); | |
while ( $loop->have_posts() ) : $loop->the_post(); | |
//customfields | |
$cfname = get_post_meta( $post->ID, 'wpcf-CFSLUGHERE', true); | |
?> | |
<!-- begin content here --> | |
<h1> | |
<?php the_title(); ?> | |
</h1> | |
<span class="customfield"> | |
<?php echo $cfname; ?> | |
</span> | |
<!-- end content here --> | |
<?php | |
endwhile; | |
wp_reset_query(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment