Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #11027

    I need to be able to change the way Portfolio items are displayed on the Portfolio overview page. By default, they appear in reverse chronology, based on the post date stamp. However, I would like to be able to order the posts by the value of a custom field. I have had some success by modifying line 12 of loop-portfolio.php as follows:

    if(isset($avia_config)) { query_posts($avia_config); }

    changed to:

    if(isset($avia_config)) { query_posts ( '&post_type=portfolio&meta_key=show_date&orderby=meta_value&order=ASC'); }

    However, by removing $avia_config['new_query'], I am no longer able to choose which categories are displayed; regardless of what I set in the template builder, posts from all categories are output.

    Can anyone offer a solution?

    Many thanks!



    Have you tried plugins like: – it’s imho easier to sort the posts this way.




    Thank you Peter, that seems like an ideal solution.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Displaying Portfolio items in order defined by custom field’ is closed to new replies.