Support » Developing with WordPress » Outputting custom fields in index.php and category.php

  • I’ve always had success outputting custom fields in individual posts via the single.php template.

    However, I’m trying to output custom fields for multiple database entries in the index.php, home.php, and category.php templates without much luck. Nothing gets outputted when I implement it this way:

    <?php $product_thumb1 = get_post_meta($post->ID, 'product_thumb1', 1); ?>
    
    <?php if (have_posts()) : ?>
    
    <?php query_posts('cat=12&showposts6'); ?>
    <?php while (have_posts() ) : the_post(); ?>
    <?php if($product_thumb1) { print $product_thumb1 } ?>
    <?php endwhile; ?>
    
    <?php endif; ?>

    Any clues?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Outputting custom fields in index.php and category.php’ is closed to new replies.