Skip to main content
WordPressWork

The Loop and Multiple Queries

By 28 May ’09September 23rd, 2015No Comments

This is the bit i’m srtuggling with:

[code]

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<h2><a href=”<?php the_permalink() ?>” rel=”bookmark”>

<?php if( get_post_meta($post->ID, “hpbottom”, true) ): ?>
<img style=”float:left;margin:0px 10px 0px 0px;width:50px; height:50px;” src=”<?php echo get_post_meta($post->ID, “hpbottom”, true); ?>” width=”150″ height=”150″  alt=”<?php the_title(); ?>” />
<?php include(TEMPLATEPATH.”/Cat_Thumb_Assign.php”);?>
<?php endif; ?>


<?php if (is_category(’28’) ): ?>
<?php include(TEMPLATEPATH.”/cat_tweet.php”); ?>
<?php else: ?>

<?php the_title(); ?></a>
</h2>
<div class=”date”>
<div class=”dateleft”>
<p><span class=”time”><?php the_time(‘F j, Y’); ?></span>
by <?php the_author_posts_link(); ?> &nbsp;<?php edit_post_link(‘(Edit)’, ”, ”); ?>
Filed under <?php the_category(‘, ‘) ?></p>
</div>

<div class=”dateright”>
<p><span class=”comment”><?php comments_popup_link(‘Leave a Comment’, ‘1 Comment’, ‘% Comments’); ?></span></p>
</div>
</div>

<?php the_content(__(‘Read more’));?><div style=”clear:both;”></div>

<!– These are the ‘tags’ markup   <div class=”postmeta2″>
<p><span class=”tags”>Tags: <?php the_tags(”) ?></span></p>
</div>–>
<div style=”border-bottom:1px dotted #2255AA; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;”></div>

<?php endif; ?>

<?php endwhile; else: ?>

<p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p>

<?php endif; ?>

[/code]

I want it to choose a thumbnail depending on the catagory (the thumbnail assigning happens in  Cat_Thumb_Assign.php). This I’ve had working no problem. Then it should  choose how to display that post dependingon wether its either catagory 28 (a twitter update) or not.

Can anyone figure this out?

Mark

Author Mark

More posts by Mark

Leave a Reply