WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Want make a template showing category (1 post)

  1. Indent
    Member
    Posted 4 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Topic