• I already saw the docs about how to define the order of your posts but I don’t know where I need to put the changes, at functions.php, index.php, etc.

    Explain how I put post of categories 3 and 6 in order by title, showing waht I need to paste and where I need to make this change.

Viewing 3 replies - 1 through 3 (of 3 total)
  • dave

    (@weboptimizers)

    Hi rgzamith,

    I am not sure if I got your question right but I will try and answer it as best as I can.

    Lets say you want to organize your posts on home page ordered by title.

    You will open your index.php and input the code as follow

    <?php
     $postslist = get_posts('numberposts=10&order=ASC&orderby=title');
     foreach ($postslist as $post) :
        setup_postdata($post);
     ?>
     <div>
     <?php the_date(); ?>
     <br />
     <?php the_title(); ?>
     <?php the_excerpt(); ?>
     </div>
     <?php endforeach; ?>

    If you wanted them to be organized based on individual categories you will simply put the category parameter in the get_posts

    so something like

    $postslist = get_posts(‘numberposts=10&order=ASC&orderby=title&category=three’);

    Does that answer your question ?

    Thread Starter Rafael Zamith

    (@rgzamith)

    I’m shure that you get it but it doesn’t work.

    The code chaged the main page and does not put at the order by title when you click at the category.

    This category that I want to put in title order is excluded from the main page.

    If it’s not at the index.php, where I need to change it?

    Thread Starter Rafael Zamith

    (@rgzamith)

    Anybody who knows it?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Put category in title order’ is closed to new replies.