Site logo

Archived topic

Shortcode not working

12 replies · Started by Travis on January 18, 2020

Viewing posts 1–13 of 13

Hello -

I'm trying to use shortcodes in a post, but it isn't working - just to confirm that it wasn't a specific plugin, I created the following in functions.php

function test_shortcodes()
{
return 'Shortcodes are working!';
}
add_shortcode('test_shortcodes', 'test_shortcodes');

and entered:
[test_shortcodes]

None of it seems to be working - any thoughts?

I’m not trying to create hero oages, I’m trying to use baseline WP shortcode functionality. Switching the theme means shortcodes work. Switching back doesn’t.

Is there anyone else available to look at this issue that is willing to try to assist?

Yes, as stated clearly above:

>I’m trying to use shortcodes in a post, but it isn’t working – just to confirm that it wasn’t a >specific plugin, I created the following in functions.php

and then stated in my follow up post to your first dismissal:

>I’m not trying to create hero oages, I’m trying to use baseline WP shortcode functionality. Switching the theme means shortcodes work. Switching back doesn’t.

*Please* get someone else to respond to this - the last time I had an issue with this theme and tried contacting support, I was similarly frustrated with your response. I need someone to actually provide the support that was supposed to be included with paying for this theme.

Looks like I was able to resolve your last two topics and one was due to your custom CSS error.

I'll get Tom to respond to this one.

I also submitted a complaint to Generate Press about the frustration I had with your communication, which apparently was directed to and responded to by you. I look forward to hearing from Tom.

Hi Travis,

Sorry for any frustration here.

GeneratePress itself doesn't alter the standard WordPress shortcode functionality, so there must be something else in play.

Do you have any other custom functions added to the theme (maybe the child theme)? Maybe one of those is preventing shortcodes from working?

Your shortcode function itself looks good.

Are you adding the shortcode inside your content? If so, are you using a Shortcode block in the editor?

How are you adding the function? In a child theme?

Let me know - we'll figure it out :)

Hi Tom,

Thanks for your prompt attention. The shortcode is being added to a post, but I've been experiencing the same issues when adding to the body of pages as well. I have a couple of custom functions, but have primarily been using the elements functionality since it's a lot easier and less prone to site-breaking... none of them seemed to be causing an issue otherwise.

I think one of the things that's vexing is that shortcodes worked at one point and then... didn't - that test function worked on the 20xx theme previews, so I was able to confirm it wasn't the plugin that created shortcodes.

It's definitely a weird issue...

Ah, and I haven't been using a shortcode block in the editor - just adding it into the text input using the Classic editor, if that's of any help.

Does it work if you use the Shortcode block?

Can you temporarily disable your other custom functions just to see if there's a conflict somewhere? Shortcodes should 100% work using GP (we use a bunch of them here on this site), so we just need to find the conflict on your site.

Thanks Tom - disabling the other custom functions seemed to restore the functionality... I'll go through and re-enable them one by one to see where the issue is.

I haven't actually updated any of the functions since well before the issue arose, which is confusing... hopefully that's all there is to it?

I assume one of them is filtering shortcodes (maybe). Feel free to share the problem function and I'll try to spot the issue.

This archived topic is closed to new replies.