Support » Fixing WordPress » New to writing Shortcodes

  • Resolved CallMeAndy


    Hi dont know if anyone can put me right – a probably a newbie stupid error but…
    writing a shortcode to list child categories based on the name of the page which implements a category and has the same name.
    In this case the Page name is Destinations which is also the name of a top level category.

    function AB_handler_get_child_cats($atts){
        $cat = get_cat_ID($category_name);
        if( $cat > 0 ){
                        'show_count' => "0",
                        'orderby' =>"name",
                    ), $atts));
            $this_category = get_category($cat);
            if (get_category_children($this_category->cat_ID) != "") {
                $html = "<div><ul>";
                $html .= "</ul></div>";
            return $html;

    If I put the following [childcats] or [childcats show_count=1 orderby=’name’] in a text widget titled “Destinations” the output is being rendered prior to the start of the widget border (outside the border).

    What am I doing wrong?

Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘New to writing Shortcodes’ is closed to new replies.