Genesis Responsive Slider – Disable Shortcode in Text

Community Forums Forums Design Tips and Tricks Genesis Responsive Slider – Disable Shortcode in Text

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  cehwitham 1 year, 8 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #19793

    NewSeasonDesign
    Participant
    Post count: 35

    I’m using the Genesis Responsive Slider on a site  for a client. It seems to be pulling shortcode if it’s within the first 75 characters of the post. Is there a way to disable the shortcode just in the slider?

    #21321

    cehwitham
    Participant
    Post count: 396

    Do you have a link to your site? It should be possible to turn of the filter that allows shortcodes to be rendered. It would be handy to see exactly what’s going on first before I suggest any code.

    You’ll need something like:

    remove_filter('content', 'do_shortcode');

    But you’ll need to target it at just the content in the slider not all pages.

    Alternatively could you use the excerpt in the slider instead of a content limit? This would then allow you to copy text into the excerpt but remove the shortcodes.


    Twitter: cehwitham Web: cehwitham.com

    #22492

    NewSeasonDesign
    Participant
    Post count: 35

    Thanks, Chris. The site is http://fabulesslyfrugal.com/. I don’t think they’ll go for the excerpts as they do up to 20 posts daily and have people working for them. So if we can avoid adding the extra step, that would be awesome.

    #22794

    cehwitham
    Participant
    Post count: 396

    This article has a section about changing the excerpt:

    http://designsbynickthegeek.com/tutorials/custom-fields-genesis-responsive-slider

    Coupled with my comment about unfiltering shortcodes it might help.

    You could also do a preg replace on the excerpt that’s generated currently using the method in the above article to remove any content between [ and ] ie a shortcode:

    http://php.net/manual/en/function.preg-replace.php


    Twitter: cehwitham Web: cehwitham.com

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.