Display all posts in current category

Try this:

$cat = get_query_var("cat');
$PozCat = get_category ($cat);
$PozCat->id // give to us current cat id.

Then use this hook in your query:

<ul>
   <?php
    $cat = get_query_var('cat');
    $PozCat = get_category ($cat);
    //$PozCat->id
    query_posts('posts_per_page=-1&cat=".$PozCat->id);
    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    <li><a href="https://wordpress.stackexchange.com/questions/70634/<?php the_permalink();?>"><?php the_title(); ?></a></li>

    <?php endwhile; endif; ?>
</ul>

Leave a Comment