Title: Shortcode not rendered
Last modified: January 13, 2020

---

# Shortcode not rendered

 *  Resolved [jeegrobot](https://wordpress.org/support/users/jeegrobot/)
 * (@jeegrobot)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/shortcode-not-rendered/)
 * Hello,
 * I’m struggling to make the plugin working, but the shortcode is shown as text
   instead of being rendered. Of course the plugin ha been activated and the Twitter
   handle has been set up.
 * The WordPress version is 5.2.4, the plugin version is 5.9.2. The website uses
   the classic editor. I’ve already tried to deactivate all the plugins except for
   BCTT but nothing changes.
 * Please help. Thanks in advance.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fshortcode-not-rendered%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Ben Meredith](https://wordpress.org/support/users/benmeredithgmailcom/)
 * (@benmeredithgmailcom)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/shortcode-not-rendered/#post-12320571)
 * Hi [@jeegrobot](https://wordpress.org/support/users/jeegrobot/)
 * I’m glad you reached out here. It looks like something is preventing the shortcode
   from rendering, which is not a problem I’ve seen very often. Usually it means
   that the theme is blocking all shortcodes in the content, or that the output 
   of that particular section of the page does not have the `the_content` filter
   turned on.
 * Are you adding that page with a page builder, or the Gutenberg editor, or the
   classic editor? I am happy to dig in here but I’ll need a way to replicate the
   problem, so the more information you give me, the better.
 * If you try creating a test page with the classic editor and including that shortcode,
   does it render correctly?
 * If so, that limits it to that one page, or the editor/page builder that you are
   using.
 * Let me know, and I am happy to keep digging.
 *  Thread Starter [jeegrobot](https://wordpress.org/support/users/jeegrobot/)
 * (@jeegrobot)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/shortcode-not-rendered/#post-12322635)
 * Hi Ben,
 * thanks for helping. I gave a try by switching the theme to a WordPress standard
   one and the shortcode works properly. So as you said, it’s a theme issue.
 * I dig into it. Thanks for the input.
 *  Thread Starter [jeegrobot](https://wordpress.org/support/users/jeegrobot/)
 * (@jeegrobot)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/shortcode-not-rendered/#post-12324593)
 * I’ve found the problem. The theme uses this code for the content
 *     ```
       while (have_posts()) :
       	the_post();
       	$content    = get_the_content();
       	$newcontent = add_anchors($content);
       	echo wpautop($newcontent);
       ```
   
 * It doesn’t use the function `the_content` because the custom function `add_anchors`
   that adds anchors to all the H2 headings, in order to link them to a TOC.
 * Do you think there is a way to make the plugin work with this code?
 *  Plugin Author [Ben Meredith](https://wordpress.org/support/users/benmeredithgmailcom/)
 * (@benmeredithgmailcom)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/shortcode-not-rendered/#post-12324747)
 * That is a great question for the theme author, to be honest. If instead of `the_content()`
   the theme is using `get_the_content()` for some reason, then shortcodes of any
   type are not supported. You can read more about that function here: [https://developer.wordpress.org/reference/functions/get_the_content/](https://developer.wordpress.org/reference/functions/get_the_content/)
 * There also may be a way to modify that custom function `add_anchors()` to also
   run it through a `get_content()` filter. I would use a child theme to explore
   that possibility.
 *  Thread Starter [jeegrobot](https://wordpress.org/support/users/jeegrobot/)
 * (@jeegrobot)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/shortcode-not-rendered/#post-12337033)
 * Thanks for your help. At the end the function `apply_filters` did the trick. 
   I replaced my last line of code `echo wpautop($newcontent);` with `echo apply_filters('
   the_content', $newcontent);` and it worked.

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

The topic ‘Shortcode not rendered’ is closed to new replies.

 * ![](https://ps.w.org/better-click-to-tweet/assets/icon-256x256.gif?rev=3482807)
 * [Better Click To Share – Shareable Quote Boxes for X (Twitter)](https://wordpress.org/plugins/better-click-to-tweet/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/better-click-to-tweet/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/better-click-to-tweet/)
 * [Active Topics](https://wordpress.org/support/plugin/better-click-to-tweet/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/better-click-to-tweet/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/better-click-to-tweet/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [jeegrobot](https://wordpress.org/support/users/jeegrobot/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/shortcode-not-rendered/#post-12337033)
 * Status: resolved