Answers for "shortcode and custom taxonomy wordpress"

PHP
0

shortcode and custom taxonomy wordpress

add_shortcode('list_portfolios', function ($atts) {
    $atts = shortcode_atts(
        array(
            'slug' => '',
        ), $atts, 'list_portfolios');

    $args = [
        'post_type' => 'portfolio',
        'tax_query' => array(
            array(
                'taxonomy' => 'danh-muc-san-pham',
                'field' => 'slug',
                'terms' => $atts['slug'],
            )
        ),
    ];
    
    $query = new WP_Query($args);

});
Posted by: Guest on July-08-2021

Code answers related to "shortcode and custom taxonomy wordpress"

Browse Popular Code Answers by Language