Newby question on selecting a single post from a category
-
Hi,
I am playing with the query_posts(‘cat=3’) I am building a results system on wordpress, like this one
anywayz, When I use that querypost to select a post from a category, and then go the get the next post, from the next category, it still fetches the post from the fist cat? probably a very simple thing, but i’m (not yet) a php programmer, so i don’t know what I do wrong. Here’s the code, please help so I can repeat this 64 times and complete my system ??
(i get the title (name) and a customfield image from the post for the results overview, the html will be replaced by css if i get the coding done)
<?php // retrieve one post from Cat of 3 query_posts('cat=3'); ?> <table> <tr> <td><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></td><td> <?php if (!get_post_meta($post->ID, "image-portfolio", true)) : // Show no image if page doesn't contain image in custom field ?> <?php else : ?> <div class="portfolio-border"> <a href="<?php echo get_post_meta($post->ID, "url-portfolio", true); ?>" title="View Project Details for <?php the_title(); ?>"> <img src="<?php echo get_post_meta($post->ID, "image-portfolio", $single = true); ?>" width="25" alt="Preview - <?php the_title(); ?>" /></a> </div> <?php endif; ?></td> </tr> </table> <?php // retrieve one post from Cat of 4 query_posts('cat=4'); ?> <table> <tr> <td><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></td><td> <?php if (!get_post_meta($post->ID, "image-portfolio", true)) : // Show no image if page doesn't contain image in custom field ?> <?php else : ?> <div class="portfolio-border"> <a href="<?php echo get_post_meta($post->ID, "url-portfolio", true); ?>" title="View Project Details for <?php the_title(); ?>"> <img src="<?php echo get_post_meta($post->ID, "image-portfolio", $single = true); ?>" width="25" alt="Preview - <?php the_title(); ?>" /></a> </div> <?php endif; ?></td> </tr> </table>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Newby question on selecting a single post from a category’ is closed to new replies.