Problem with Getting Custom Fields in Ver 3.0???
-
I have been working on developing a site for about a month now and have been using the Beta version to get things up and running knowing that I wanted to use Ver 3.0 when it became available. But since upgrading it seems my templates don’t pull in custom field data anymore.
I was using the code below to list out ALL custom fields for a particular key. The key being “Product_image”. So it would build an list of images for a gallery and all I had to do was just put the file name of the jpeg in the custom field for each post. Worked perfectly in the Beta 2 of 3.0, but has since stopped working.
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?php $press_quotes = get_post_meta($post->ID, "Product_image", false); if ($press_quotes[0]=="") { ?> <!-- If there are no custom fields, show nothing --> <?php } else { ?> <?php foreach($press_quotes as $press_quotes) { echo '<li><img src="/10-images/product-images/'.$press_quotes.'"alt="product"/></li>'; } ?> <?php } ?> <?php endwhile; ?> <?php endif; ?>
Any ideas on how I can fix this?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Problem with Getting Custom Fields in Ver 3.0???’ is closed to new replies.