Support » Themes and Templates » Display content of latest post of certain category

  • Sphagnum


    I’m building a custom website for a group of friends who are getting a band off the ground. I’m building the website mostly in some basic html, styled with CSS, but in cooperating some WordPress functions into it so that these guys (who are not very tech savy) can make use of the WordPress editors on the back end to keep their website up to date (and limiting the time I have to spend doing anything with it). So here’s what I’m trying to do, but so far haven’t been able to figure out by myself.

    On the front page of this website, I have a the theme all set up and a small area dedicated to a “welcome message” where I want the guys to be able to update this with maybe where they are playing most recently and whatnot. My idea is to have any posts they make in WordPress that use the Category slug “FrontPage” or something like that be listed here. But I only want the LASTEST post of that category to be listed here. I have a basic loop written in now:

    <?php while (have_posts()) : the_post(); ?>
    	<?php the_content(); ?>
          <?php endwhile; ?>

    But that is going to show ALL posts in ALL categories, how to edit it so only the LAST post in ONE category shows up.

    Any help in the right direction would be greatly appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display content of latest post of certain category’ is closed to new replies.