Support » Fixing WordPress » Want make a template showing category

  • Resolved Indent

    (@indent)


    I want a page to show posts from a specific category and I’ve tried this:

    I made a template just like the archive.php, and placed this before the loop,

    <?php
    query_posts('cat=4');
    ?>

    the thing is that the page have subpages and has a menu in the sidebar based on this:

    <?php
    if($post->post_parent)
    $children = wp_list_pages("title_li=&amp;child_of=".$post->post_parent."&amp;echo=0");
    else
    $children = wp_list_pages("title_li=&amp;child_of=".$post->ID."&amp;echo=0");
    if ($children) { ?>
    <ul>
    <?php echo $children; ?>
    </ul>
    <?php } ?>

    But, when I use anything but the default template (page.php) the sidebar menu of that page just disappear. Can’t I list subpages when the page uses another template other than the default?

    Any ideas how to do this? Thanks!

  • The topic ‘Want make a template showing category’ is closed to new replies.