• [ Moderator note: moved to Fixing WordPress. Please do not use Developing With WordPress for these topics. ]

    Hi Guys !. I created a shortcode visual composer get post by custom taxonomy. But when I get all custom taxonomy (for dropdown category on visual backend editor) it not working.
    my code:
    $args1= array(
    ‘taxonomy’ => ‘danh_muc’, // my custom taxonomy
    ‘hide_empty’ => 0,
    );
    $inra=array();
    $danhmucs= get_terms($args1);
    foreach ($danhmucs as $danhmuc) {
    $tendm=$danhmuc-> name;
    $iddm=$danhmuc-> term_id;
    $inra[$tendm]=$iddm; }
    vc_map( array(
    “name” => __(“News”, ‘understrap’),
    “base” => “tintuc”,
    “class” => “”,
    “category” => ‘Content’,
    “icon” => “icon-wpb-application-icon-large”,
    “params” => array(
    array(
    “type” => “dropdown”,
    “holder” => “div”,
    “class” => “”,
    “heading” => “Danh m?c”,
    “param_name” => “cat”,
    “value” => $inra,
    “description” => ‘Ch?n danh m?c B?S c?n hi?n bài ??ng’,
    ),
    )
    ));

    But When I change ‘taxonomy’ => ‘danh_muc’ to ‘taxonomy’ => ‘category’ it working fine !
    I var_dump careful $inra with 2 cases: ‘taxonomy’ => ‘danh_muc’ and ‘taxonomy’ => ‘category’, The results are the same
    Thanks all !

    • This topic was modified 7 years, 8 months ago by aminor1993.
    • This topic was modified 7 years, 8 months ago by Jan Dembowski.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘create a visual composer shortcode with custom taxonomy but not working’ is closed to new replies.