WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Issue sorting posts by title (3 posts)

  1. tomkinsg
    Member
    Posted 6 years ago #

    Hey folks, I am really struggling with this. Here is my site:

    http://www.tarheeldiving.com/category/profiles/

    The three titles there are posts in category 29 and I have set up a category-29.php template in my theme to provide a different format for this specific page. My problem is that I can not sort this list by the title.

    This is my loop:

    <?php get_header(); ?>
    
    	<div class="main">
    
    		<div class="content">
    
    	<?php
    query_posts($query_string . '&orderby=title&order=ASC');
    if (have_posts()) : ?>
    		<?php while (have_posts()) : the_post(); ?>
    			<div class="post" id="post-<?php the_ID(); ?>">
    
    <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h1>
    
    ...

    This was the line i added to force the sort order:

    query_posts($query_string . '&orderby=title&order=ASC');

    I know the category-29 template is in use and I know that the above line is taking effect since I can insert other parameters such as put &p=25 in there and i get very different results.

    What am i doing wrong here? Any suggestions.

    thanks
    Glyn

  2. tomkinsg
    Member
    Posted 6 years ago #

    anyone any ideas on this? I still have not got this working and I have followed the example in the codex on alphabetising the list to the letter but it doesn't work. I am using latest WP - 2.3.1

    neither of these two links alphabetises by title:

    http://www.tarheeldiving.com/?cat=17&orderby=title&order=asc
    http://www.tarheeldiving.com/?cat=29&orderby=title&order=asc

    thanks
    Glyn

  3. tomkinsg
    Member
    Posted 6 years ago #

    OK ... i just figured this out through playing with other people's blogs.

    The issue is that I have "Sticky" plug in activated and it stops all attempts at putting orderby=... in the url, in the theme or anywhere.

    I'll report it to the author.

    thanks
    Glyn

Topic Closed

This topic has been closed to new replies.

About this Topic