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.

Reorder Portfolio Items

  • Creator
    Topic
  • #582
    clcfish29
    Member

    I need some help customizing the portfolio. I would like to be able to order / reorder video posts in the portfolio, rather than the most recently created item showing up first. I’m mediocre at best at editing php, but if you can tell me where & how to edit the code to make this happen, I’d really appreciate it! Or, is there a plugin I should install that won’t interfere with your theme that allows me to do this?

    Thank you!

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #587
    Jason Bobich
    Keymaster

    Hello,

    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.
Viewing 1 replies (of 1 total)

The forum ‘Commodore WordPress Theme (formerly Complexity)’ is closed to new topics and replies.