WordPress query_post setting variables
-
Hello all,
I’ve been struggling to create a second loop that would run on my home page (go see at https://www.htgp.org). I have the standard wordpress loop running lower on the index page, but its getting stuck on the loop I’m trying to create now.
The goal for this loop is to have the last 5 posts from the ‘Slides’ Category show up in the formatted way I have, but I’m using custom fields to do this, and I’m doing the same as I did for my thumbnail system which you can see at: https://www.htgp.org/blog.
but it’s obviously not working and giving me a parse error.
I could really use some help on this… this is the code I have so far :…….
<?php query_posts('category_name=blog&showposts=5'); $slide-image = get_post_meta($post->ID, 'Slide-img', $single = true); $thumb-image_class = get_post_meta($post->ID, 'Slide-img Class', $single = true); ?> <?php if (have_posts()) : while (have_posts()) : the_post();?> <div id="slideshow"> <div id="slide-image-wrap"> <div class="slide-img"> <?php if($slide-image !== '') { ?> <a href="<?php the_permalink() ?>"> <img border="none" src="<?php echo $slide-image; ?>" class="<?php echo $slide-image_class; ?> slide-image" alt="<?php the_title(); ?>" /> </a> <?php } else { ?> <a href="<?php the_permalink() ?>"> <img border="none" src="https://www.htgp.org/wp-content/themes/HTGP/images/backgrounds/slide-default.png" class="left" alt="<?php the_title(); ?>" /> </a> <?php } ?> </div> <div id="slide-text-wrap"> <div class="slide-title"> <a href="<?php the_permalink() ?>"><h2><?php the_title(); ?></h2></a> </div> <div class="slide-excerpt"> <?php the_excerpt(); ?> </div> </div> </div> <?php endwhile; ?> <?php endif; ?>
Now this is the complete loop I’ve made this far for generating the ‘slides’ category posts, and it does not work.
Thanks in advance,
Alex
- The topic ‘WordPress query_post setting variables’ is closed to new replies.