Custom Fields not displaying.
-
I am trying to set up a custom field on my category page which gives a short description of the post. It doesn’t seem to be working although I have this exact code set up the same and working properly on a different site. This is the loop from my category.php page hopefully someone can see something I can’t.
The if statement just checks if English or French is selected in qTranslate.
<?php while ( have_posts() ) : the_post(); ?> <?php //This checks what language qTranslate has selected and returns the appropriate ShortDesc if (ppqtrans_getLanguage() =="en") { $key = "byline_en"; $description = get_post_meta($post->ID, $key, true); } if (ppqtrans_getLanguage() =="fr") { $key = "byline_fr"; $description = get_post_meta($post->ID, $key, true); } ?> <div class="product_thumbnail"> <a href="<?php the_permalink() ?>"> <?php //the_post_thumbnail grabs the post's "featured image" this feature has added theme support in the child theme functions.php ?> <?php the_post_thumbnail('thumbnail', array('class' => 'thumbnail')); ?> </a> <?php //This piece of code figures out the corrosponding post_title of the featured image ?> <h1 class="post_caption"><?php the_title(); ?></h1> <?php echo $description; ?> </div> <!-- product_thumbnail --> <?php endwhile; // end of the loop. ?>
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Custom Fields not displaying.’ is closed to new replies.