diff --git a/includes/shortcodes/carousel-owl.php b/includes/shortcodes/carousel-owl.php index 62b5a19..3131275 100644 --- a/includes/shortcodes/carousel-owl.php +++ b/includes/shortcodes/carousel-owl.php @@ -63,7 +63,7 @@ function shortcode_carousel_owl( $atts, $content = null, $shortcodename = '' ) { $get_category_type = $post_type == 'post' ? 'category' : $post_type.'_category'; $categories_ids = array(); foreach ( explode(',', str_replace(', ', ',', $categories)) as $category ) { - $get_cat_id = get_term_by( 'name', $category, $get_category_type ); + $get_cat_id = get_category_by_slug($category); if ( $get_cat_id ) { $categories_ids[] = $get_cat_id->term_id; } @@ -212,4 +212,4 @@ function shortcode_carousel_owl( $atts, $content = null, $shortcodename = '' ) { return $output; } add_shortcode( 'carousel_owl', 'shortcode_carousel_owl' ); -} ?> \ No newline at end of file +} ?>