Same code, image displays on home and single post, not on category page
-
If I make a post in my site and add an image to it, the image shows up on the post page, as well as the blog home page which lists all of the links, but it does not show up on the category page, even though the exact same code exists on that page as on the home and single post pages. In order for the image to actually appear on the category page, I have to copy the location of the file and paste it into an “image/photo” field that appears to be added as part of the theme. I am using what I believe is an older theme called Business Professional Package.
My question is – how can I dig in and figure out why the same code shows an image in one page but does not show an image in another? The code that shows the image is this:
<?php if( get_post_meta($post->ID, "post_image_value", true) ) { ?> <img class="portfolio-full" src="<?php bloginfo('template_url'); ?>/image.php?width=570&image=<? echo get_post_meta($post->ID, 'post_image_value', true) ?>" alt="<? the_title() ?>" /> <? } ?>
This code shows an image when it is placed on the home.php page or on a single.php single post page, but it does not work on category.php. Any guidance would be so welcome. I seem to be out of my pay grade on this.
Thanks you,
William Alexander
- The topic ‘Same code, image displays on home and single post, not on category page’ is closed to new replies.