Forums

Where to place edit? (2 posts)

  1. kathleane
    Member
    Posted 4 years ago #

    Newbie here - trying to alphabetize my posts. I found info on how to get my posts to sort alphabetically which advised to Edit your theme's index.php with the following
    ==============================
    ?php
    // we add this, to show *all* posts sorted
    // alphabetically by title
    $posts = query_posts($query_string . '&orderby=title&order=asc&posts_per_page=-1');
    // here comes The Loop!
    if (have_posts()) : while (have_posts()) : the_post(); ?>
    ===============================
    I did so and my page parsed incorrectly so I guess that I placed the code incorrectly. My question is where do I place this code and is this bit of code replacing code already on the page or simply added in a certain spot?

  2. Pinoy.ca
    Member
    Posted 4 years ago #

    Did the suggestion of the person who helped you yesterday worked? Say thank you then.

    It replaces code already on the page. Take out everything you changed earlier and put $posts = query_posts($query_string . '&orderby=title&order=asc&posts_per_page=-1'); immediately before the existing line that says if (have_posts()) : while (have_posts()) : the_post();.

    If my suggestion helped, do visit my profile page one of these days.

Topic Closed

This topic has been closed to new replies.

About this Topic