This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Reply To: Reorder Portfolio Items

Jason Bobich


First off, keep in mind that if you just want to manually manipulate the order of the Portfolio items without making any code changes, you can. You’d just simply edit the publish dates of your post, which in WordPress, you can always do at any time.

If you’d like to actually modify the query string on how these posts are ordered, you’d do so by modifying it in taxonomy.php, which is the theme file responsible for displaying custom taxonomies. In this case, there is only one, which is the taxonomy grouping “portfolios” —

So, in taxonomy.php, you’d find this line and then insert whatever kind of order and orderby attribute you want.

<?php query_posts("paged=$paged&portfolio=$term_slug&posts_per_page=$themeblvd_items_per_page"); ?>

So, for example, if you wanted them to be ordered by title and then to be ascending (i.e. A-B-C opposed to Z-Y-X), then it would look like this:

<?php query_posts("order=ASC&orderby=title&paged=$paged&portfolio=$term_slug&posts_per_page=$themeblvd_items_per_page"); ?>

Now, if you want there to actually be an Order option when editing portfolio items, you’d need to not only edit the query string but also make the portfolio item custom post type hierarchal.

Open /includes/theme_functions/portfolio.php and on line 30, where you see this:

'hierarchical' => false,

You want to change it to this:

'hierarchical' => true,

Then, again in taxonomy.php, you’d edit the query string, but now make it ordered ascending by menu_order so the lower the order number, the higher it will show on the portfolio page.

<?php query_posts("order=ASC&orderby=menu_order&paged=$paged&portfolio=$term_slug&posts_per_page=$themeblvd_items_per_page"); ?>

Note: To everyone, please keep in mind that support does not normally include customizations like this, as outlined in our support terms. This is a special case because this is a question that comes up so often with this theme.