Forums

[resolved] Loop in sidebar - duplicate post links (1 post)

  1. duffbeer
    Member
    Posted 2 months ago #

    Thanks in Advance, I have been pulling my hair out over this...

    I have some code in the sidebar that pulls out recent posts, works fine in IE in all situations.
    However, in Firefox it only works consistantly when viewing from the main blog page, and from a "page". When viewing a single post sometimes its ok, other times the tag is closed prematurely, instead of getting the image, title and text all together, I get an image, then title, and then text.

    This doesnt happen when the query returns a single post.

    also, If remove the text, it works fine all the time. If I leave the text and remove the image, it sometimes goes a bit weird.

    <?php $the_query_recent = new WP_Query('showposts=3&offset=5');
    					while ($the_query_recent->have_posts()) : $the_query_recent->the_post();?>
    
    		<a class="feature" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>">
    		<img class="feature_img" src="<?php echo get_option('home'); ?>/wp-content/uploads/<?php echo get_post_meta($post->ID, "thumb_home_img", $single = true); ?>" alt="<?php the_title(); ?>" />
    		<div class="feature_title"><?php echo get_post_meta($post->ID, "featured_title", $single = true); ?></div>
    		<div class="feature_text"><?php echo get_post_meta($post->ID, "featured_text", $single = true); ?></div>
    		</a>
    
    	<?php endwhile; ?>

Reply

You must log in to post.

About this Topic