Forums

Add post title to wp query loop (2 posts)

  1. justinstyle
    Member
    Posted 2 years ago #

    Ive added a query loop to display post images on my front page, what i would like to do is add post titles to this. can you tell me how i could alter this code to add it above the pictures?

    <?php query_posts('showposts=8&orderby=date&order=DESC'); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    <?php if (get_first_image($post->ID, 'pic_90_70_', true) ) { ?>
    "><img alt="<?php the_title_attribute(); ?>" src="http://magaribeipoa.com/wordpress/wp-content/themes/Sitemile_ClassifiedTheme/<?php echo get_first_image($post->ID, "pic_90_70_", $single = true); ?>" border="0" style="padding-right: 10px; padding-left: 10px;/>
    <?php } ?>

    <?php endwhile; endif; ?>

  2. justinstyle
    Member
    Posted 2 years ago #

    maybe this isnt in the right category? any suggestions?

Topic Closed

This topic has been closed to new replies.

About this Topic