Plugin Contributor
Tracy Levesque
(@liljimmi)
🏳️🌈 YIKES, Inc. Co-Owner
Hi Robin,
This is a question you would need to ask the theme author. You can ask them if Their theme option accepts shortcodes, and if not, is there a fix for it.
The area you are editing may actually be a widget area and by default, they do not accept shortcodes.
Report back and let us know what they say.
Thank you!
-Tracy
Hi Rob,
Unfortunately it looks like the theme that you have chosen to use is doing some very weird, and unconventional things.
For one – they are defining their own content filter, and stripping any and all shortcodes. I assume this is an upsell to the pro version. I personally do not like this approach, as it is stripping default WordPress behavior – to upsell you on a premium product.
Inside of index.php on line 161 the theme has:
skt_white_the_content_format( $content );
Now, following that theme into functions.php you’ll see the next two blocks of code:
// get_the_content format text
function skt_white_get_the_content_format( $str ){
$raw_content = apply_filters( 'skt_white_the_content', $str );
$content = str_replace( ']]>', ']]>', $raw_content );
return $content;
}
// the_content format text
function skt_white_the_content_format( $str ){
echo skt_white_get_the_content_format( $str );
}
You’ll see inside of skt_white_get_the_content_format, that they are stripping the shortcodes:
$content = str_replace( ']]>', ']]>', $raw_content );
return $content;
You can alter the theme to support shortcodes – but my professional recommendation would be to leave this theme altogether for one that doesn’t strip away basic WordPress features to try upsell you to a pro version.
Thanks,
Evan
Thread Starter
Rob.
(@rob-1)
Hi Evan,
Thank you very much for the explanations.
Indeed I understood afterward that the theme I chose is not quite common and I should probably have changed earlier as you are suggesting, however I already did quite a lot of work on my website and I’d like to stick to this theme now.
What I find strange also is that I am using shortcodes for the multiple languages handling with the plugin qTranslate-X : [:en]…[]. Why is this working then?
Anyway, may I ask if it would need a lot of modifications to change the functions.php file in order to support your shortcode? And if not too complicated can you help me do so?
Thanks again for your help, I really appreciate !
Robin
I would recommend taking a look at the review I left on the theme, and how to work around it. You will have to make alterations to the base theme, which is ultimately going to keep reverting on every update they push out – but if you choose to stick with this theme, that may be your only option.
https://ww.wp.xz.cn/support/view/theme-reviews/skt-white?filter=2
You’ll just need to alter one function found in functions.php of that theme.
The shortcodes don’t work on the homepage in each section. They work everywhere else, on standard pages and posts.
Evan
Thread Starter
Rob.
(@rob-1)
Thank you very much Evan. Clear, concise and helpful explanations, you were of great help !
Robin
Thread Starter
Rob.
(@rob-1)
Hi again,
Sorry to come back on this subject but actually the solution you described in your comment didn’t solve my problem. The shortcode of your plugin is still not recognized in the main page…
Would you have any other idea by chance?
Thanks a lot for your help.
Robin
Unfortunately not. During my tests, the fix mentioned above resolved the issue.
My recommendation would be to wait for the theme author.
Thanks,
Evan