WordPress.org

Ready to get started?Download WordPress

Forums

Archive for the ‘Uncategorized’ in sidebar to display as alphabetized title list (10 posts)

  1. Tara
    Member
    Posted 3 years ago #

    Hi all,
    I use WP default theme.

    My all posts are posted under "uncategorized"

    In the sidebar, when "uncategorized" is clicked, by default full posts are listed by date.

    How can I have them listed alphabetically in titles instead?

    Thanks in advance.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

  3. Tara
    Member
    Posted 3 years ago #

    Thanks a lot esmi!

    I appreciate your response very much.

    I read that many times.

    I tried the following but it did not do the trick.
    <?php wp_list_categories('show_count=1&orderby=title&order=ASC&title_li=<h2>Categories</h2>'); ?>

    Obviously I am not applying the codex right. Please guide. thanks again.

  4. khiangte
    Member
    Posted 3 years ago #

    <?php query_posts('orderby=name&order=ASC');
    if(have_posts()): while(have_posts()): the_post();
    ?>
    <h2>"><?php the_title?></h2>
    <?php endwhile; else; endif; ?>

    This code will list all posts TITLE in alphabetical order :

    I hope that will help

  5. khiangte
    Member
    Posted 3 years ago #

    <?php query_posts('orderby=name&order=ASC');
    if(have_posts()): while(have_posts()): the_post();
    ?>
    <h2><a href="<?php the_permalink()?>"><?php the_title?></a></h2>
    <?php endwhile; else; endif; ?>

    This code will list all posts TITLE in alphabetical order :

    I hope that will help

  6. Tara
    Member
    Posted 3 years ago #

    Thanks khiangte.

    I tried both and both gives me parse error:

    Parse error: parse error, unexpected ';', expecting ':' in /home/XXX.../html/blog/wp-content/themes/mytheme/sidebar.php on line 100

  7. khiangte
    Member
    Posted 3 years ago #

    ohh my mistake ...

    change else

    ;
    to else
    :
    , or you can remove else statement otherwise you want to put some code if there is no post

  8. khiangte
    Member
    Posted 3 years ago #

    else; TO else: , see the difference ,semicolon to colon LOLZ

  9. Tara
    Member
    Posted 3 years ago #

    Thanks khiangte for your help, time and pasient.

    I changed that but no luck.

    Please know that I am trying to modify the existing "uncategorized" item in the sidebar. After all said and done, I would like to be able to click on "uncategorized" and be able to see all content listed with titles only, alphabeticaly instead of now (WP default) which when I click "uncategorized", full posts are listed by date.

    Thanks esmi and khiangte.

  10. khiangte
    Member
    Posted 3 years ago #

    can you give me a link to your site..

Topic Closed

This topic has been closed to new replies.

About this Topic