Okay
  Public Ticket #854561
Portfolio Items Order
Closed

Comments

  • Maria started the conversation

    Hello!

    First of all, thank you for this wonderful theme :).

    The only problem I have encountered (and it may be due to an error on my part) is with the order of portfolio items on the main page. The page is managed by custom query, with select from category (all but one are selected). It's set to order by list order, ascending, but it seems to be ignoring this and going by date, with the oldest post being the first displayed.  I also have Post types order installed. Since the trouble started after switching to custom query, my best guess is that I am doing something wrong there. 

    Thank you so much for your assistance!

  •  1,558
    Laborator replied

    Hi Maria,

    Can you please send us your WordPress site URL, username and password? We need to investigate your site and then get back to you if we have a possible solution.

    Make sure to choose Private Reply when you send us sensitive informations!

    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group

  •   Maria replied privately
  • [deleted] replied

    Hi Maria,

    After investigating the issue I came in solution and that is by adding the following code in functions.php (end of the file):

    // Set Correct Order (Menu Order) for portfolio items in the homepage
    function set_menu_order_sorting_for_portfolio_homepage_items( $query ) {
    if ( is_home() || is_front_page() ) {
    $query['orderby'] = 'menu_order';
    }
    return $query;
    }

    add_filter( 'kalium_portfolio_pre_query', 'set_menu_order_sorting_for_portfolio_homepage_items' );
    I've also enabled Post Types Order plugin in order to make this working.

    FYI I saw that in "Portfolio" page you have filled these 2 sections:


    (view large version)

    So, the selected items are not being filtered in the portfolio query.

  • Maria replied

    Hi Arlind,

    Thank you very much for your help, all is well now :)!

    Have a great day,

    all the best,

    Maria


  • [deleted] replied

    Great to hear that Maria, many thanks for your positive rating.

    Anytime you need help, feel free to write here.