Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <ul class="flavorlist">
- <?php
- //FFUUUUUUUCKKKKK. I think the part below...
- $temp = $wp_query;
- $args = array(
- 'category_name' => 'flavor',
- 'showposts' => 20,
- 'orderby' => 'title',
- 'order' => 'ASC',
- 'paged' => $paged
- );
- $flavorsPosts = new WP_Query($args);
- foreach ($flavorsPosts as $post) :
- setup_postdata($post);
- $count++;
- $test = $count-1;
- ?>
- <li class="flavor <?php if (is_int($test/5)) echo 'first'; ?>">
- <?php
- // ...is conflicting with the part below, perhaps.
- //Get images attached to the post
- $args = array(
- 'post_type' => 'attachment',
- 'post_mime_type' => 'image',
- 'numberposts' => -1,
- 'order' => 'ASC',
- 'post_status' => null,
- 'post_parent' => $post->ID
- );
- $attachments = get_posts($args);
- if ($attachments) {
- foreach ($attachments as $attachment) {
- $img = wp_get_attachment_thumb_url( $attachment->ID );
- $imglink = wp_get_attachment_url( $attachment->ID );
- break;
- } ?>
- <a href="<?php echo $imglink; ?>" title="<?php the_title(); ?>"><img src="<?php echo $img; ?>" alt="yummy cupcake" /></a>
- <? } else { ?>
- <img class="default" src="<?php bloginfo('template_directory'); ?>/images/default.jpg" alt="Photo Coming Soon" width="60" height="60" />
- <?php } ?>
- <h3><?php the_title(); ?></h3>
- <p><?php the_excerpt(); ?></p>
- </li>
- <?php endforeach; ?>
- </ul>
Add Comment
Please, Sign In to add comment