Display Posts Only In Category x? (2 posts)

  1. twilitegxa
    Posted 4 years ago #

    I have the following code:

    if (is_page()) {
      $posts = get_posts ("showposts=12");
      if ($posts) {
        foreach ($posts as $post):
          setup_postdata($post); ?>
          <div style="border: 2px solid #ebebeb; width: 210px; float: left; margin-right: 25px; margin-bottom: 25px; padding: 5px;">
    <h4 style="font-size: 14px; font-weight: bold; padding-bottom: 10px;"><?php the_title(); ?></h4>
    <div style="float: right; padding-left: 5px;">
    <?php the_post_thumbnail(); ?>
    	<span style="font-size: 12px;"><?php the_content(); ?></span>
        <?php endforeach;

    How can I make the posts display that are only in the category named "Training Summary" (slug "training-summary")? Any help would be greatly appreciated!

  2. Just use an array like the first example on this page:


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.