• Resolved Wiki Chaves

    (@wikichaves)


    Hi,

    I’ve created a new custom post type archive page for my “People” (archive-people.php) and worked fine, till I’ve decided to sort the list in a particular way.

    I’ve included
    $posts = query_posts($query_string . '&orderby=title&order=asc'); ?>

    before if (have_posts()) : ….

    Doing this i can see the first entries of each page duplicated

    Am I doing something wrong or there is a bug with the CPT archive page ?

    Thanks
    Wiki

Viewing 2 replies - 1 through 2 (of 2 total)
  • I just set up my archives, and they went well except one issue.

    Seems if I do any sort of query, then I need to specify the CPT in the query

    for instance I had this in my archive-ve_members.php:

    query_posts( array(
          'posts_per_page' => 30,
          'order' => 'ASC',
          'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1 ),
     ));

    Because I wanted 30 members to show at a time, and I wanted the posts to display backwards, from first added to most recent

    Before I put that query in, everything worked perfectly. As soon as I added that query, I had all sorts of other posts and duplicate content show up. But when I put

    'post_type' => 've_members',

    in there, all was right with the world again….. Seems a bit odd to me. Seems dropping in any sort of query messes up the expected output…..

    Thread Starter Wiki Chaves

    (@wikichaves)

    Great ! seems that i had somethig bad in my query

    Thanks !

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom post type Archive duplicates posts if Sorted (by title for example)’ is closed to new replies.