New Landing How can we help? Themeforest Theme Support Dante Portfolio – anyway to make them automatically list in alphabetical order?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Posted in: Dante
  • #118446
    bitstormdesign
    Member
    Post count: 25

    Anyway to make my portfolio display in alphabetical order? I installed a re-order plugin but its not ideal really as I have to change the order each time a new portfolio page is added.

    Thanks

    Will

    #118503
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    I will forward this to Mohammad, he will assist you shortly

    – Kyle

    #118547
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please open to edit sf-portfolio.php at /dante/includes/

    Find this code:-
    $portfolio_args=array(
    	    		'post_type' => 'portfolio',
    	    		'post_status' => 'publish',
    	    		'paged' => $paged,
    	    		'portfolio-category' => $category_slug,
    	    		'posts_per_page' => $item_count,
    	    		'tax_query' => array(
    	    				array(
    	    					'taxonomy' => 'portfolio-category',
    	    					'field' => 'id',
    	    					'terms' => array( $exclude_categories ),
    	    					'operator' => 'NOT IN'
    	    				)
    	    			)
    	   		);
    
    Change to-:
    
    $portfolio_args=array(
    'orderby'=> 'title', 
    'order' => 'ASC',
    	    		'post_type' => 'portfolio',
    	    		'post_status' => 'publish',
    	    		'paged' => $paged,
    	    		'portfolio-category' => $category_slug,
    	    		'posts_per_page' => $item_count,
    	    		'tax_query' => array(
    	    				array(
    	    					'taxonomy' => 'portfolio-category',
    	    					'field' => 'id',
    	    					'terms' => array( $exclude_categories ),
    	    					'operator' => 'NOT IN'
    	    				)
    	    			)
    	   		);

    Thanks
    Mohammad

    #118553
    bitstormdesign
    Member
    Post count: 25

    Thankyou perfect

    #118555
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Thanks Mohammad

    – Kyle

    #204314
    bsastre
    Member
    Post count: 1

    Hi,
    Is there a way I can replicate this solution in a child theme?
    I don’t want to have to paste this code every time I update the theme…

    Thank you in advance.

    #204453
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    You can copy the entire function from the sf-portfolio.php that now is located in Dante/includes/
    and paste it inside the functions.php of the child theme, then change it has desired.

    The function starts with these 2 lines

    
    if (!function_exists('sf_portfolio_items')) { 
    		function sf_portfolio_items($display_type, $columns, $show_title, $show_subtitle, $show_excerpt, $hover_show_excerpt, $excerpt_length, $item_count, $category, $exclude_categories, $pagination, $sidebars) {
    	
    

    Hope it helps.

    -Rui

    #204464
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please copy the full function sf_portfolio_items after change this code. And paste it functions.php file of child theme.
    Thanks
    Mohammad

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

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

License required for one of the following items
Login and Registration Log in · Register