• Is there any way to get an alphabetical listing of posts in any given category? I’d like to create a page or post that lists the 148 posts I have it in that category and have each link to their respective posts. Any help would be amazing.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Add this line:

    <?php if (is_category()) { $posts = query_posts($query_string . '&orderby=title&order=asc'); } ?>

    above this line:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    Thread Starter antonskey

    (@antonskey)

    awesome, and is there any way to then only get the title from each post as opposed to the entire post? i’m using the blue radiant theme and it doesn’t have an archive.php file, so would i need to add one?

    Either that or a category.php template; see Template hierarchy in the Codex: https://codex.www.ads-software.com/Template_Hierarchy
    Once you have created it (e.g. saving your index.php as archive.php or category.php) you can delete the call for the_content (and anything else you don’t need) and have only the clickable titles.

    Thread Starter antonskey

    (@antonskey)

    wow, i think i’m finally getting the hang of things a little. i think this will be my last question, and that’s is there any way now to specify that i want ALL the posts in that category on that one page without changing the Options->Reading to 148?

    Not really, but there are at least two plugins that make possible to have different number of posts in different views:
    https://www.ads-software.com/support/topic/31491#post-177815

    Thread Starter antonskey

    (@antonskey)

    that’s perfect, thank you very much.

    Actually, there is.

    Again, here’s my code from my index.php (main page):

    <?php if (is_category()) { $posts = query_posts($query_string . '&orderby=title&order=asc&posts_per_page=-1'); } ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    The ‘posts_per_page=-1’ tells it to post them all.

    Here is the code further down that tells it whether to use just the title & date or output content too:

    <?php if (is_home() || is_date() || is_author()) { ?>
    <div class="meta"><?php _e("filed under"); ?> <?php the_category(',') ?> <?php _e("on");?> <?php the_time('l j F Y'); ?> <?php _e("at");?> <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
    <?php } else { ?>
    <div class="meta"><?php _e("on");?> <?php the_time('l j F Y'); ?> <?php _e("at");?> <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
    <?php } ?>

    <?php if (!is_category() || !is_archive()) { ?>
    <div class="storycontent">
    <?php if (is_home() || is_date() || is_author() || is_archive() || is_category()) {
    if ( in_category('5') ) { the_excerpt_reloaded(30, <i><em><img><a><b>
    <ul>
    <li>
    <ol><br>, content, TRUE, (more...), TRUE, 2, TRUE);
    } else {
    the_excerpt_reloaded(50, <i><em><img><a><b>
    <ul>
    <li>
    <ol><br>, content, TRUE, (more...), TRUE, 2, TRUE);
    }
    } else { the_content(); }?>
    </div>

    (Note: I am using the_excerpt_reloaded () plug-in rather than the default the_excerpt() function.)

    Here‘s how my category pages look as opposed to my index page.

    nmallory I like the way yr category page looks, but somehow I’m not able to get this code to work. I’m a newb which might be the cause, but I need help, pls.. When I add the code in my index file it returns a blank page.. Where am I doing wrong? Thanks for yr input..

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘alphabetical listing of posts????’ is closed to new replies.