Skip to content

Instantly share code, notes, and snippets.

@marisqaporter
Created November 17, 2016 19:49
Show Gist options
  • Save marisqaporter/6a89a7c809eb4e6829782efb1c10a771 to your computer and use it in GitHub Desktop.
Save marisqaporter/6a89a7c809eb4e6829782efb1c10a771 to your computer and use it in GitHub Desktop.
not-so-awesome-product-loop
<?php
$args = array(
'post_type' => 'accessory', // enter your custom post type
);
$loop = new WP_Query( $args );
if( $loop->have_posts() ):
echo '<div id="acc-wrapper">';
while( $loop->have_posts() ): $loop->the_post(); global $post;
?>
<div class="my-acc">
<div class="my-acc-inner">
<div class="acc-image">
<?php the_post_thumbnail( 'acc-size' ); ?>
</div>
<!-- right column -->
<div class="acc-desc">
<?php the_title( '<h3>', '</h3>' ); ?>
<h4>$<?php the_field('price'); ?></h4>
<?php the_content(); ?>
</div>
<!-- end right col -->
</div><!-- end container --> </div>
<?php
endwhile;
echo '</div>';
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment