• Resolved teknoledge

    (@teknoledge)


    I have a function that pulls latest 10 entries from specific category and it works fine.

    The problem is I have couple of custom fields for posts in that category that I’d like to be displayed as well but get_post_meta doesnt return anything?

    Looks like this:

    <?php
    function get_phone_offers($cat, $showposts) {
    ?>
    <?php query_posts("cat=$cat&showposts=$showposts");?>
    <?php if (have_posts()) : ?>
    <div class="table">
    	<?php while (have_posts()) : the_post();
    //	$thePostID = $post->ID;
    $thePostID = $post_id;
    .
    .
    .
    	echo get_post_meta($thePostID, "Offer End", $single = true);
    .
    .
    .
    <?php endwhile; ?>
    <?php endif; ?>
    <?php } ?>

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get_post_meta in function.php’ is closed to new replies.