Created
November 17, 2016 19:49
-
-
Save marisqaporter/6a89a7c809eb4e6829782efb1c10a771 to your computer and use it in GitHub Desktop.
not-so-awesome-product-loop
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 | |
$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