Title: [Plugin: Shortcode Exec PHP] List Categories
Last modified: August 19, 2016

---

# [Plugin: Shortcode Exec PHP] List Categories

 *  [Naz](https://wordpress.org/support/users/naz/)
 * (@naz)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-shortcode-exec-php-list-categories/)
 * The wp_list_categories tag and the the_tags tag don’t appear to work with the
   Shortcode Exec PHP plugin.
 * I get the following message when I click the ‘Test’ button:
 * > [list_categories]=””
   > Unexpected output, do not use ECHO but RETURN
 * When I use the following code (the list_categories shortcode uses the wp_list_categories
   tag) the list with categories actually shows up above the ‘Categories’ header.
 *     ```
       <h4>Categories</h4>
   
       [list_categories]
       ```
   
 * I used the following code for the [list_tags] shortcode:
 * `the_tags('<ul><li>','</li><li>','</li></ul>');`
 * The tags don’t show up at all.
 * Thanks in advance for your help!

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

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-shortcode-exec-php-list-categories/#post-1925998)
 * `wp_list_categories()` echoes (directly outputs) the list, unless you set the‘
   echo’ paarameter to ‘false’
    [http://codex.wordpress.org/Template_Tags/wp_list_categories](http://codex.wordpress.org/Template_Tags/wp_list_categories)
 * as for `the_tags()` [http://codex.wordpress.org/Function_Reference/the_tags](http://codex.wordpress.org/Function_Reference/the_tags)
   
   it might be that the connection to the loop is lost where it is called; try to
   add `global $post;` before the line. anyway, it outputs/displays the results 
   immediately, which makes it unsuitable to use in a shortcode – consider working
   with [http://codex.wordpress.org/Function_Reference/get_the_tags](http://codex.wordpress.org/Function_Reference/get_the_tags)
 *  Thread Starter [Naz](https://wordpress.org/support/users/naz/)
 * (@naz)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-shortcode-exec-php-list-categories/#post-1926142)
 * I fixed the wp_list_categories() by making sure ‘Output Echoed’ was checked.
 * I used the wp_tag_cloud() tag for the tags. Oops!
 * I just recently moved the site and my old shortcodes were lost (I have a question:
   are the shortcodes saved somewhere in the database? I can’t find them), so I 
   guess I did something wrong when I recreated the shortcodes. 🙂
 * Thanks for your help!

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

The topic ‘[Plugin: Shortcode Exec PHP] List Categories’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/shortcode-exec-php.svg)
 * [Shortcode Exec PHP](https://wordpress.org/plugins/shortcode-exec-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcode-exec-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcode-exec-php/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcode-exec-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcode-exec-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcode-exec-php/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Naz](https://wordpress.org/support/users/naz/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-shortcode-exec-php-list-categories/#post-1926142)
 * Status: not resolved