Skip to content

Instantly share code, notes, and snippets.

@jonaslsl
Created January 19, 2015 11:57
Show Gist options
  • Save jonaslsl/495e884674218f2e4842 to your computer and use it in GitHub Desktop.
Save jonaslsl/495e884674218f2e4842 to your computer and use it in GitHub Desktop.
types plugin loop
<?php
$args = array( 'post_type' => 'clients' , 'posts_per_page' => '-1' );
$c = new WP_Query( $args );
if( $c->have_posts() ) {
while( $c->have_posts() ) {
$c->the_post();
$extraClasses = wp_get_post_terms($post->ID, 'client_cat', array("fields" => "slugs")); ?>
<?php foreach ($extraClasses as $key => $value) { echo $value . ' '; } ?>"
<?php echo types_render_field("url",array("raw"=>"true")); ?>">
<?php echo types_render_field("image",array("raw"=>"true","separator"=>";")); ?>"
<?php
}
}
else {
echo 'No posts defined';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment