Title: Adding shortcode to TOC +
Last modified: August 3, 2017

---

# Adding shortcode to TOC +

 *  [jamezon](https://wordpress.org/support/users/jamezon/)
 * (@jamezon)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/adding-shortcode-to-toc/)
 * Hi,
 * It is easy to add shortcode to a text widget by either using a plugin or adding
   the following to the functions file:
 * add_filter( ‘widget_text’, ‘shortcode_unautop’ );
    add_filter(‘widget_text’, ‘
   do_shortcode’);
 * This enables you to use a shortcode such as a date and then displaying a current
   or dynamic date in your widget sidebar.
 * Is there a way to actually enable shortcode execution (specifically for a dynamic
   or current date) for Table of Contents Plus?
 * There is nothing wrong with the shortcode, since it works in in the post area
   when I add it to the headings and allow the table of contents to display in the
   post area.
 * The problem is that I show the table of contents in the sidebar and when I do,
   the actual shortcode is showing and not the date.
 * Wordpress does not support shortcodes in widgets or the sidebar as far as I know,
   unless you add a filter.
 * Can anyone help please?

The topic ‘Adding shortcode to TOC +’ is closed to new replies.

 * ![](https://ps.w.org/table-of-contents-plus/assets/icon-256x256.png?rev=1151771)
 * [Table of Contents Plus](https://wordpress.org/plugins/table-of-contents-plus/)
 * [Support Threads](https://wordpress.org/support/plugin/table-of-contents-plus/)
 * [Active Topics](https://wordpress.org/support/plugin/table-of-contents-plus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/table-of-contents-plus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/table-of-contents-plus/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [jamezon](https://wordpress.org/support/users/jamezon/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/adding-shortcode-to-toc/)
 * Status: not resolved