List categories short code in sidebar

Community Forums Forums Design Tips and Tricks List categories short code in sidebar

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  nutsandbolts 11 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #80198

    Manifest
    Participant
    Post count: 4

    Hello,
    I use Genesis 2.0 with Genesis Sample Theme and I want to list specific post categories in my sidebar. I built a short code that I put in a text widget but my list of categories appears outside the text-widget area at the top left of the sidebar instead of in my text widget.

    Can someone help me with this ? Here’s the code that I use:

    
    //*List a specific category
    function category_wine_shortcode($atts) {
    $st_bordeaux = wp_list_categories('include=6&show_count=1' );
    	echo '<div class="listcat">';
    	echo '<ul>';
       return  $st_bordeaux;
    echo '</ul>';
       echo '</div>';
    }
    
    add_shortcode('catbordeaux', 'category_wine_shortcode'); 
    
    //*Apply short code in text widget
    add_filter('widget_text', 'do_shortcode');
    
    • This topic was modified 11 months, 1 week ago by  Manifest.
    • This topic was modified 11 months, 1 week ago by  Manifest.
    • This topic was modified 11 months, 1 week ago by  Manifest.
    • This topic was modified 11 months, 1 week ago by  Manifest.
    #80357

    nutsandbolts
    Keymaster
    Post count: 3187

    Can you post a link to the site?


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.