Forums

Category Titles not showing (2 posts)

  1. meylo
    Member
    Posted 3 years ago #

    Hey, maybe someone can help... I created static pages and pasted this code to grab only posts in specific categories.

    <h2><?php single_cat_title(); ?></h2>
    <?php
    // retrieve posts from Cat 123
    query_posts('cat=6');

    global $more;
    // set $more to 0 in order to only get the first part of the post
    $more = 0;

    // the Loop
    while (have_posts()) : the_post();
    // the content of the post
    the_content('Read the full post ยป');
    endwhile;
    ?>

    The posts show but the post-titles are missing... any ideas?

    -m

  2. MichaelH
    Volunteer
    Posted 3 years ago #

    It is not necessary to create static Pages to display a set of posts from a category...WordPress will do that automatically for you. Consider this techinique if necessary:
    How to easily display links to both Pages and Categories in the blog navigation header?

    But if that does satisfy then look at:
    http://codex.wordpress.org/Pages#A_Page_of_Posts

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.