Sort portfolio images

  • Posted in : BookCard WP
  • reaven
    Participant

    how i can sort the portfolio images in alphabetic order.

    Mehmet S.
    Keymaster

    You can try the plugin:

    Post Types Order

    http://wordpress.org/plugins/post-types-order

    reaven
    Participant

    well thanks but that wont work, with the plugin you have to manually sort it and thats not the idea…, I know it can be coded but I didnt find where but today i find it and it works soooo here I share…,

    look in Appearance -> Editor for ‘page_inner-portfolio.php’ and search for :

    $args_portfolio = array( ‘post_type’ => ‘portfolio’, ‘posts_per_page’ => -1

    and add this :

    , ‘orderby’ => ‘title’, ‘order’ => ‘ASC’

    The whole line will end looking like this:

    $args_portfolio = array( ‘post_type’ => ‘portfolio’, ‘posts_per_page’ => -1, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’ );

    * everything will depend how you want to order it here is all the orderby parameter you can apply:

    reaven
    Participant
    Mehmet S.
    Keymaster

    Thanks for sharing.

    reaven
    Participant

    no problem at all, the theme is super cool !

    elmarione
    Participant

    Thanks you two.

    johnyct9760
    Participant

    – When it to appearance > editor
    – then I selected “page_inner-portfolio.php”
    – found the line that says:
    $args_portfolio = array( ‘post_type’ => ‘portfolio’, ‘posts_per_page’ => -1 );

    and then changed it to:

    $args_portfolio = array( ‘post_type’ => ‘portfolio’, ‘posts_per_page’ => -1, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’ );

    Then I hit update file, and when I got out to the front end none of my portfolio items are showing up.

    I’ve followed the instructions in the last post and its not working, What am I doing wrong?

    Mehmet S.
    Keymaster

    Hi,

    There is invalid code character in the plain text. Please copy this code line:

    $args_portfolio = array( 'post_type' => 'portfolio', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC' );
    

    Thanks

    LittleRedRoosterCreative
    Participant

    I tried this and various other methods suggested elsewhere, and it does arrange them on the portfolio page as desired, but once you open an image, if you use the big arrows at the top of the page to scroll to the next or previous portfolio item, the order does not match – still as per original order. Also similar problems with Post Types Order Plugin.
    If anyone else like myself, just wants to re-order their portfolio in a different order to which they created the Portfolio Items, simply edit the ‘Published date’ in each.
    Not sure if this is really obvious, but I spent HOURS before finding this solution so thought I’d share!

    Mehmet S.
    Keymaster

    Thanks for the sharing.

    shutterape
    Participant

    If you have some departments and some portfolio items on the portfolio page, is there a way to arrange them in alphabetical order? I tried changing the code as above but that only ordered the portfolio items and not the departments.

    Mehmet S.
    Keymaster

    Hi, you can try the following plugin.

    https://wordpress.org/plugins/taxonomy-terms-order/

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

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register