Created
February 6, 2019 12:13
-
-
Save yousufansa/83718bbaf1236c1da62d931ae1e9b81a to your computer and use it in GitHub Desktop.
Electro - Show only Specific Brands By Slug in Custom Order
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( ! function_exists( 'ec_child_footer_bc_modify_tax_args' ) ) { | |
function ec_child_footer_bc_modify_tax_args( $args ) { | |
$args['slugs'] = 'dell, apple, microsoft, ibm, sony, samsung, hp'; //Replace slugs with your slugs in need order | |
if ( ! empty( $args['slugs'] ) ) { | |
$cat_slugs = is_array( $args['slugs'] ) ? $args['slugs'] : explode( ',', $args['slugs'] ); | |
$cat_slugs = array_map( 'trim', $cat_slugs ); | |
$args['slug'] = $cat_slugs; | |
$args['orderby'] = 'slug__in'; | |
$args['order'] = 'ASC'; | |
} | |
return $args; | |
} | |
} | |
add_filter( 'ec_footer_bc_taxonomy_args', 'ec_child_footer_bc_modify_tax_args', 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment