Many WordPress StudioPress Themes include a Portfolio. A need I had recently was to order the Portfolio items alphabetically as the default is to order by Post number. There are no options in the Genesis dashboard settings but fortunately its really simple to order the portfolio alphabetically.
Instructions to set Portfolio sort order
To set the StudioPress Genesis Portfolio sort order to be alphabetical:
- Open the child Theme functions.php for editing
- Change the following
/** Change the number of portfolio items to be displayed (props Bill Erickson) */ add_action( 'pre_get_posts', 'executive_portfolio_items' ); function executive_portfolio_items( $query ) { if( $query->is_main_query() && !is_admin() && is_post_type_archive( 'portfolio' ) ) { $query->set( 'posts_per_page', '12' ); } }to
/** Change the number of portfolio items to be displayed (props Bill Erickson) */ add_action( 'pre_get_posts', 'executive_portfolio_items' ); function executive_portfolio_items( $query ) { if( $query->is_main_query() && !is_admin() && is_post_type_archive( 'portfolio' ) ) { $query->set( 'orderby', 'title' ); $query->set( 'order', 'ASC' ); $query->set( 'posts_per_page', '12' ); } } - Save the changes.
The Portfolio will now show in alphabetical order.
