• Ive got a problem.. At the startpage all my posts are visible. And at one of my pages i have only got post of category 7, thats is a blogpage. I want to know how to only show posts from category 4 at the main index page. Instead of showing all the posts i just want to filter the post from category 4 and not the “blog” posts from category 7.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Try editing your theme’s index.php file and changing:

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

    to:

    <?php if (have_posts()) : ?>
    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'cat' => 4,
    	'paged' => $paged
    );
    query_posts($args);
    ?>
    <?php while (have_posts()) : the_post(); ?>
    Thread Starter bortas

    (@bortas)

    Thanks alot esmi! I wonder if there is any way of getting a 300 signs roof, so i cant write more than 300 signs at the front page, to view the whole news i hade to click like “read more”.

    Best Regards
    Sebastian

    300 signs roof? Sorry – I don’t follow…

    if I had to venture a guess here…..I’d think the OP wanted a 300 character teaser on the index page, then a read more? maybe?

    oh…waitaminuite….this rings a bell….

    http://ww.wp.xz.cn/support/topic/341368?replies=2
    (I have no idea how I made the connection…)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Show a category..’ is closed to new replies.