• Hi there,

    I am trying to fetch the most recent post in a specific category and display it in a box on my custom home page. I am using the following code in my “custom_home.php” template page.

    <?php $recent = new WP_Query("cat=39&showposts=1"); while($recent->have_posts()) : $recent->the_post();?>
    <?php $values = get_post_custom_values("teaser_thumb"); echo $values[0]; ?>
    <?php endwhile; ?>

    Now the important thing to point out here is that this works perfectly on my local installation of wordpress. All I have to do is create a post, add a custom field called “teaser_thumb” and place it in the relevant category (category 39). Then whatever I put in that custom field is displayed in the box.

    For some reason, when I do the same thing on my LIVE installation of wordpress. The content isn’t being displayed. The code is identical, the post is there. It’s assigned to the correct category but the box is just blank.

    Any ideas?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Posts from Specific Category’ is closed to new replies.