get_post_meta(); wont work...

Hello everyone,

So I havent been programming long, and I’ve only done this a few times, but I’ve come across a problem that I cannot seem to figure out. I am making a website which will be, basically, a newsletter. My client wants to send out a newsletter every month, but then link the newsletter to the website which would post the articles in the same template format as the newsletter. I’ve got everything showing up fine. However, they also want an archives page which gives a monthly archive of the newsletters. To tackle this problem, I am trying to create a function which will output to the page each category (each article type is in a different category) in the same structure. I created the function which takes the parameter of the category and number of posts to display, I pass that into it, and it displays the title, content, etc. and it works… sort of.

I have a custom field with a image path, and for some reason, when I run the function, everything come out perfectly, except the image path. I cannot get it to echo ANYTHING! I use other template functions, like bloginfo('template_directory); , and it works fine. But when I try to add the image path behind that, nothing works. I’ve been struggling with this for weeks now. Any help would be GREATLY appreciated!!! So far, my code is:
[php]function retry($catposts) {
query_posts($catposts);
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>


<?php the_title(); ?>

                                    <?php $banner = get_post_meta($post->ID, 'banner-image', true);
					
				if($banner != '') { ?>

					<img src="<?php bloginfo('template_directory');?><?php echo $banner; ?>"/>
				<?php } ?>
				
				<div class="content">
				<?php the_content(); ?>
				</div>
				</div>
	<?php endwhile; 
wp_reset_query();

endif;
}[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service