Here you can see the shortcodes being displayed instead of the content that the shortcode generates: hidden link PASSWORD: cucumber
This page is generated by a Content template. The shortcode is being displayed by pulling in a user field using a second shortcode provided by Memberpress. If I add the shortcodes you can see on the page manually to the content template, they display the content as desired, as you can see for the Twitter feed. I can see the shortcodes pulled in form the user field have inverted commas around them for some reason.
Thank you for contacting us and I'd be happy to assist.
It looks like the second shortcode from Memberpress is showing the field's content as it is as a text value. And since no content filters are being applied to that text value, the inner shortcode is not getting expanded into the relevant output.
To overcome this, you can register a third custom shortcode, which:
- first gets the value from the user field, and then
- apply the WordPress 'the_content' filter to it ( ref: https://developer.wordpress.org/reference/hooks/the_content/ ), and then
- return that final expanded output
If I add the twitter shortcode and the facebook shortcode, I get 2 twitter feeds (Its running the twitter code twice even though I am using 2 different shortcodes). If I have the Facebook shortcode on its own then it works.
I need to run multiple shortcodes on a single page to create multiple feeds. Why is it doing this?
I'm not exactly sure why the output of one shortcode is affected by the use of another one. But, I was able to make this work, using a slightly different approach.
Instead of registering separate custom shortcodes for each social field, you can register just one common shortcode, which can process the shortcodes enclosed within its opening and closing tags: