WordPress.org

Ready to get started?Download WordPress

Forums

Ordering a category page (3 posts)

  1. saviornelas
    Member
    Posted 10 years ago #

    I have the following category and subcategories
    foobar id=1
    --> foo id=2
    --> bar id=3
    Now what I want to do is make "index.php?cat=1" show something like this
    --------------------------------
    FOOBAR
    >> FOO
    Entries in subcategory FOO
    >> BAR
    Entries in subcategory BAR
    --------------------------------
    I have tried to use includes. The entries of FOO appear normally but in BAR the FOO entries appear again.
    Any suggestion?

  2. carthik
    Member
    Posted 10 years ago #

    what exactly is the code that you use to display FOO normally and BAR+FOO mixed up?
    We could start from there :)

  3. saviornelas
    Member
    Posted 10 years ago #

    For FOO
    <?php
    $cat='2';
    require_once('./wp-blog-header.php');
    ?>
    <?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
    <?php the_content(); ?>
    <?php endforeach; else: ?>
    <?php _e("Error"); ?>
    <?php endif; ?>
    and for BAR I just change cat to '3'.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.