• Hello, did shortcode tags for goods. Maybe someone needs …
    Add to file shortcodes.php

    ///////////////////////////////////
    function хGoodsTag($atts) {

    // Attributes
    extract(shortcode_atts(
    array(
    ‘name’ => ”,
    ),
    $atts)
    );

    // Code
    $output = ‘<div class=”goods-insert”>’;
    $the_query = new WP_Query(array(‘post_type’ => ‘goods’, ‘goods_tag’ => $name,’posts_per_page’ => -1));
    if ($the_query->have_posts()):
    while ($the_query->have_posts()):
    $the_query->the_post();
    $output .= goods_shortcode_output();
    endwhile;
    endif;
    wp_reset_query();
    return $output . ‘</div>’;
    }

    add_shortcode(‘goods_tag’, ‘хGoodsTag’);
    //Usage: [goods_tag name=”tag name”]

    https://www.ads-software.com/plugins/goods-catalog/

  • The topic ‘Shortcode for tag (Шоткод для меток)’ is closed to new replies.