• I am trying to list all posts from one category in the sidebar. What I have below isn’t working for me.

    <ul>
    <?php $temp_query = $wp_query; query_posts("showposts=100&cat=185&sort=post_title&order=ASC"); ?>
    <?php while (have_posts()) { the_post(); ?>
    <li><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
    <?php } $wp_query = $temp_query; ?>
    </ul>

    Any help is greatly appreciated. Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    Try it with this:

    query_posts("posts_per_page=100&cat=185&orderby=title&order=ASC");

    https://codex.www.ads-software.com/Function_Reference/WP_Query#Order_.26_Orderby_Parameters

    Thread Starter tx01

    (@tx01)

    Thanks for the response keesiemeijer. That didn’t work either.

    Moderator keesiemeijer

    (@keesiemeijer)

    Try it with this:

    <ul>
    <?php
    $the_query = new WP_Query('posts_per_page=100&cat=185&orderby=title&order=ASC');
    while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
    <li><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
    <?php endwhile; ?>
    </ul>

    What isn’t working? Does it show a list with posts but not in alphabetical order?

    Thread Starter tx01

    (@tx01)

    still the same result..It’s showing the posts, just not in alphabetical order. Thanks!

    Moderator keesiemeijer

    (@keesiemeijer)

    Something is interfering with the query.

    Try:
    – deactivating all plugins to see if this resolves the problem? If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    – switching to the default theme to rule out any theme-specific problems.

    Thread Starter tx01

    (@tx01)

    I think you may be right about the plugin. I am using wp-sticky for this site. I’m afraid to deactivate in fear of losing current stickies, but I looked it up and others are having the same issue. Thanks for looking into it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘list posts in one category in alphabetical order’ is closed to new replies.