Portfolio Items no longer ordered with update

resolved (4 posts) (2 voices)

  1. SashKat
    Member

    Is there a way of reordering the portfolios on a gallery page? Before the update I was able to do that, but now the option is gone.

    Posted 2 years ago #
  2. Elliott
    Support

    Hello SashKat,

    See here, http://mysitemyway.com/support/topic/ordering-my-portfolio.

    Posted 2 years ago #
  3. SashKat
    Member

    I'm sorry but 15-portfolio.php looks different now in the new update.

    This is line 133 -165

    if( strpos( $disable, 'pagination' ) === false ) {
    
    				$portfolio_query->query(array(
    					'post_type' => 'portfolio',
    					'posts_per_page' => $showposts,
    					'tax_query' => array(
    						'relation' => 'IN',
    						array(
    							'taxonomy' => 'portfolio_category',
    							'field' => 'slug',
    							'terms' => explode(',', $cat)
    						)
    					),
    					'offset' => $offset,
    					'paged' => $paged
    				));
    
    			} else {
    
    				$portfolio_query->query(array(
    					'post_type' => 'portfolio',
    					'posts_per_page' => $showposts,
    					'tax_query' => array(
    						'relation' => 'IN',
    						array(
    							'taxonomy' => 'portfolio_category',
    							'field' => 'slug',
    							'terms' => explode(',', $cat)
    						)
    					),
    					'offset' => $offset,
    					'nopaging' => 0,
    				));

    How do I add this without breaking it?

    $portfolio_query->query(array(
    	'post_type' => 'portfolio',
    	'posts_per_page' => $showposts,
    	'taxonomy' => 'portfolio_category',
    	'term' => $cat,
    	'offset' => $offset,
    	'paged' => $paged,
    	'meta_key' => 'portfolio_order',
    	'orderby' => 'meta_value_num',
    	'order' => 'ASC',
    ));
    Posted 2 years ago #
  4. Elliott
    Support

    Change it so it looks like this,

    if( strpos( $disable, 'pagination' ) === false ) {
    
    	$portfolio_query->query(array(
    		'post_type' => 'portfolio',
    		'posts_per_page' => $showposts,
    		'tax_query' => array(
    			'relation' => 'IN',
    			array(
    				'taxonomy' => 'portfolio_category',
    				'field' => 'slug',
    				'terms' => explode(',', $cat)
    			)
    		),
    		'offset' => $offset,
    		'paged' => $paged,
    		'meta_key' => 'portfolio_order',
    		'orderby' => 'meta_value_num',
    		'order' => 'ASC',
    	));
    
    } else {
    
    	$portfolio_query->query(array(
    		'post_type' => 'portfolio',
    		'posts_per_page' => $showposts,
    		'tax_query' => array(
    			'relation' => 'IN',
    			array(
    				'taxonomy' => 'portfolio_category',
    				'field' => 'slug',
    				'terms' => explode(',', $cat)
    			)
    		),
    		'offset' => $offset,
    		'nopaging' => 0,
    		'meta_key' => 'portfolio_order',
    		'orderby' => 'meta_value_num',
    		'order' => 'ASC',
    	));
    Posted 2 years ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme