Skip to content

Instantly share code, notes, and snippets.

@yousufansa
Created February 6, 2019 12:13
Show Gist options
  • Save yousufansa/83718bbaf1236c1da62d931ae1e9b81a to your computer and use it in GitHub Desktop.
Save yousufansa/83718bbaf1236c1da62d931ae1e9b81a to your computer and use it in GitHub Desktop.
Electro - Show only Specific Brands By Slug in Custom Order
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