Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #989354

    Enfold theme – I want to sort my portfolio items by menu order – how do I add this? I see it as an option in Masonry for home page to display Portfoilio items to sort by Page Order but I don’t see that under Screen Options? Is there a function I can use to get order working as we need these in a specific order. Thanks

    #989593

    Hey calnettech2,

    Thank you for using Enfold.

    The “page-attribute” feature is not supported by the portfolio post type by default so you have to enable it. Add this filter in the functions.php file.

    /* Change portfolio post type settings */
    add_filter('avf_portfolio_cpt_args', 'avf_portfolio_cpt_args_mod');
    function avf_portfolio_cpt_args_mod($args) {
    	$args['supports'][] = 'page-attributes';
    	return $args;
    }

    Best regards,
    Ismael

    #989788

    Added the function – thanks! but still not sorting as expected. There is a masonry block on the home page that is sorting by page order, ascending, which is not sorting even with the new function and menu order added to portfolio items.

    Also I have a widget in the 2nd footer widget area. How do I get that to sort with Page order as well.

    #989824

    Nevermind about Home page – I got that working! Is there a way to sort the second footer widget portfolio list? THANKS

    #990085

    Hi,

    Added the function – thanks! but still not sorting as expected.

    Did you adjust the value of the page attributes > “order” field for each portfolio items?

    Best regards,
    Ismael

    #990286

    Please read the latest post – I figured out the home page. Function didn’t translate exactly right but I fixed it. Now I want to sort the second footer widget portfolio list in the same manner.

    #990650

    Hi,

    You can create a custom portfolio with a new query. Add this code in the functions.php file.

    add_action('after_setup_theme', function() {
    	class avia_portfoliobox_custom extends avia_newsbox
    	{
    		function __construct()
    		{
    			$this->avia_term = 'portfolio_entries';
    			$this->avia_post_type = 'portfolio';
    
    			$this->avia_new_query = array("order" => 'ASC', "orderby" => 'menu_order', "posts_per_page" => 10, 'post_type' => $this->avia_post_type);
    
    			$widget_ops = array('classname' => 'newsbox', 'description' => __('A Sidebar widget to display latest portfolio entries in your sidebar', 'avia_framework') );
    
    			WP_Widget::__construct( 'portfolioboxnew', THEMENAME.' Latest Portfolio New', $widget_ops );
    		}
    	}	
    
    	register_widget( 'avia_portfoliobox_custom' );
    });
    
    

    Look for the “Portfolio New” widget. You can set the query in this line.

    $this->avia_new_query = array("order" => 'ASC', "orderby" => 'menu_order', "posts_per_page" => 10, 'post_type' => $this->avia_post_type);
    

    Best regards,
    Ismael

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.