• Hi….I’m an ex-Movabletyper that recently switched to WordPress. I’m attempting to display specific categories, which, in Moveabletype would have been accomplished this way:

    <MTEntries category=”category name”>….</MTEntries>

    This seems like a simple task, but I’ve spent way to much time browsing topics that don’t specifically address this issue. Any help?

Viewing 3 replies - 1 through 3 (of 3 total)
  • First: welcome to WP!
    I know the biggest challenge when switching from another script is to stop thinking in the “old way”. Usually the internal logic of two applications – even if on the surface they aim the same goal, like blogging – could be very different.
    It depends where do you want to display the posts of one category. By deafult, clicking on a category name in the sidebar – all the posts of that category will be displayed. If you want to avhieve this on the main page of the blog, you’ll have to get familar with the query_posts tag and apply it in your theme’s template file(s).

    Thread Starter Thad Allender

    (@endortrails)

    Thanks for the reply. I figured it out. The problem arose because of the PLACEMENT of the tag required for this. Here is the tag (which I have set to display just posts from category 10 on my index page:

    <?php if ( in_category(’10’) ): ?>

    And here is where it should be placed in relation to The Loop:

    <?php get_header(); ?>

    <!– content …………………………… –>
    <div id=”content”>

    <?php if (have_posts()) : ?>

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

    <?php if ( in_category(’10’) ): ?>

    <hr class=”low” />

    <div class=”entry”>

    <h2>” title=”Permalink”><?php the_title(); ?></h2>

    <?php ($post->post_excerpt != “”)? the_excerpt() : the_content(); ?>

    </div>

    <?php endif; ?>

    <?php endwhile; ?>

    <?php else : ?>

    <h2>Not Found</h2>
    Sorry, but you are looking for something that isn’t here.

    <?php endif; ?>

    </div>

    <!– /content –>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

    I have this functioning as a page template. But I’d like the information that I post on the page to be shown..IE. the page name and information, and THEN all of the posts in the category. Is there a way to do this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display posts from specific category’ is closed to new replies.