Enable Shortcodes For WP Sections

8 replies
Hello,

I'm not real familiar with coding, but I have an issue that maybe someone can help with.

I have a plugin that gets inserted into pages by shortcode. However, I'm having difficulty putting the plugin on the homepage because my homepage uses sections not pages. It works fine on default WP pages but not on homepage "sections." The plugin creator said I need to enable shortcodes for sections, but didn't tell me how to do that.

So my questions is, how can I get the shortcode to work for WP sections to? I'd appreciate any help, thanks!
#enable #sections #shortcodes
  • Profile picture of the author Nuke07
    Originally Posted by chaotic squid View Post

    Hello,

    I'm not real familiar with coding, but I have an issue that maybe someone can help with.

    I have a plugin that gets inserted into pages by shortcode. However, I'm having difficulty putting the plugin on the homepage because my homepage uses sections not pages. It works fine on default WP pages but not on homepage "sections." The plugin creator said I need to enable shortcodes for sections, but didn't tell me how to do that.

    So my questions is, how can I get the shortcode to work for WP sections to? I'd appreciate any help, thanks!
    Try it manually..

    <?php echo do_shortcode('Your Shortcode here');?>
    {{ DiscussionBoard.errors[9595134].message }}
  • Profile picture of the author chaotic squid
    ok but where do I put that? I tried putting that in a few areas but it doesn't seem to help
    {{ DiscussionBoard.errors[9595578].message }}
  • Profile picture of the author David V
    Originally Posted by chaotic squid View Post

    ...So my questions is, how can I get the shortcode to work for WP sections to? I'd appreciate any help, thanks!


    This will depend on how the theme author created those "sections".
    IF they are just wigetized areas you would need to enable shortcodes in widgets.

    Add the following to your functions.php file:

    Code:
    add_filter( 'widget_text', 'shortcode_unautop');
    add_filter( 'widget_text', 'do_shortcode');
    NOTE: This may already be enabled in your theme.
    You could test it by putting a short code into one of your widgets and see if it functions properly.
    If it does, the code above is already in the theme.

    Might be fastest to just ask the theme author directly.

    As Nuke07 pointed out, you could put his code snippet directly into the php file to execute the shortcode but I would avoid hardcoding it like that or you'll have to manually edit the php file every time you want to make a change.
    {{ DiscussionBoard.errors[9595748].message }}
  • Profile picture of the author chaotic squid
    hmm still not working, and neither the plugin creator or theme author won't help since the plugin creater says it's the theme and the theme author says it's the plugin. Pisses me off because I paid for both the plugin and theme but neither want to take responsibility and help
    {{ DiscussionBoard.errors[9596594].message }}
  • Profile picture of the author David V
    What's the theme and the plugin your using?
    {{ DiscussionBoard.errors[9596610].message }}
  • Profile picture of the author chaotic squid
    Solved it!

    Got someone on Elance to help. Seems like the issue was within the plugins main php file where there was a condition that it was only enabled on singular pages. Removed the condition and got it to work.

    Thanks for all your help and suggestions though
    {{ DiscussionBoard.errors[9596798].message }}
  • Profile picture of the author David V
    Excellent! Glad you got it working.
    {{ DiscussionBoard.errors[9597921].message }}

Trending Topics