Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #281531

    Hi, i have this problem: i can see the portfolio items in proper order (starting from the latest post) only in two pages of my client’s website, which are the pages where I don’t filter by category.
    If i add a category filtered portfolio it won’t show me the latest posts in first place. I didn’t find any ordering option in the portfolio section, Is this something you can help me with?
    Thanks in advance

    #281549

    Hi luca8link!

    If you want to apply a custom order to your portfolio entries I suggest to use this plugin: https://wordpress.org/plugins/post-types-order/
    If you just want to sort them by date or title you can add additional sorting options to the portfolio element screen – see: http://www.kriesi.at/documentation/enfold/how-to-add-an-orderorderby-option-to-the-blogpost-sliderportfoliomasonry-grid-element/

    Best regards,
    Peter

    #281553

    Hi and thanks for the quick reply.
    The second option you suggest would be the better for this website, for I need that when my client adds a new work it is the first one in each page including it as a portfolio item.

    Tried to add the code to functions.php but i can’t see the additional options in the theme options panel. Could it be because the given solution is for “enfold” while I’m using “choices”?

    Thanks again,
    L

    #281904

    Hi!

    Yes, I didn’t check the theme name – please excuse my mistake. Around 95% of all support requests each day are submitted by Enfold users :)

    Yes, Choices does not support this code but you can change the order of the portfolio entries with a filter function. Insert it into the child theme functions.php or enfold/functions.php:

    
    function loop_portfolio_query($location)
    {
    	if($location == 'loop-portfolio')
    	{
    		global $avia_config;
    		if(isset($avia_config['new_query']))
    		{
    			$avia_config['new_query']['orderby'] = "date";
    			$avia_config['new_query']['orderby'] = "ASC";
    			query_posts($avia_config['new_query']);
    		}
    	}
    }
    add_action('avia_action_query_check' , 'loop_portfolio_query', 10, 1);
    

    and replace ASC with DESC for a descending order or “date” with “title” to sort the items based on the post titles.

    Cheers!
    Peter

    #281960

    Hi Peter and thanks again. I added the code and tried to change some options but unfortunately nothing changes in the product page portfolios

    #282093

    Hey!

    I edited Dude’s code a bit. Please use this:

    function loop_portfolio_query($location)
    {
    	if($location == 'loop-portfolio')
    	{
    		global $avia_config;
    		if(isset($avia_config['new_query']))
    		{
    			$avia_config['new_query']['orderby'] = "date";
    			$avia_config['new_query']['order'] = "ASC";
    			query_posts($avia_config['new_query']);
    		}
    	}
    }
    add_action('avia_action_query_check' , 'loop_portfolio_query', 10, 1);

    Best regards,
    Ismael

    #282138

    Hi Ismael, thank you. Unfortunately that doesn’t work either. Plus, it also changed the order in the pages where it was correct (home and portfolio with all categories)

    #282317

    Hey!

    Please create us an admin account – the sort order should be applied to all portfolio grids regardless of their location. I need to check the post order and configuration first hand.

    Cheers!
    Peter

    #282370
    This reply has been marked as private.
    #282881

    Hi!

    I just can’t find the option you mentioned to select the items order even after adding the function.

    Yes, because the code will only work with Enfold. Choices does not support additional option fields for the sort order and you can only change the order with a filter ( http://www.kriesi.at/support/topic/portfolio-items-ordering/#post-281904 ) which will affect all portfolio grids. You can only change the order by changing the code directly and not with a dropdown/option field. I’ll check if the filter changes the sort order on your website though.

    Best regards,
    Peter

    #282886

    Hey!

    Ok, I just tested it and it seems to work. I.e. if I view this page: http://www.falegnameria-rotaluigi.it/prodotti/serramenti-in-legno/ the sort order is: FINESTRE IN LEGNO, SERRAMENTI, FINESTRE IN LEGNO, FINESTRE IN PVC, FINESTRE IN PVC, SERRAMENTO IN LEGNO. Now if I replace the sort order here: http://www.falegnameria-rotaluigi.it/wp-admin/theme-editor.php?file=functions.php&theme=choices

    
    $avia_config['new_query']['order'] = "ASC";
    

    with

    
    $avia_config['new_query']['order'] = "DESC";
    

    (descending order instead of ascending order) the order changes to SERRAMENTO IN LEGNO, FINESTRE IN PVC, FINESTRE IN PVC, FINESTRE IN LEGNO, SERRAMENTI, FINESTRE IN LEGNO.

    Cheers!
    Peter

    #282929

    Hi Peter, it works and it’s perfect for what I needed. Thank you

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

The topic ‘Portfolio items ordering’ is closed to new replies.