benPog
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Stripping shortcodes, keeping the contentDone =)
Thanks again!
Forum: Fixing WordPress
In reply to: Stripping shortcodes, keeping the contentSorry for the late answer, I did not have Internet access anymore.
Yes, the second code proposition actually does the trick (except that the resulting content is not wrapped in <p> tags, but that’s actually beneficial to my design). Thanks a lot!
Is there any way to “close” this topic (like adding a [solved] tag) ?
Forum: Fixing WordPress
In reply to: Stripping shortcodes, keeping the contentI think my problem wasn’t understood. My bad for not having been clear enough.
I don’t want the shortcodes to be activated in the excerpts. I want the shortcodes to be hidden, but keep the text content between them (as my shortcodes are like opening and closing tags).
By default, WordPress deletes all content inside the [shortcode]content[/shortcode] tags when using the strip_shortcodes() function (which I assume is used when displaying the_excerpt()).
I guess the best solution would be a custom excerpt function using a regexp (that strips all “[*]” and “[/*]” expressions), but I’m not familiar with this.
Thanks for your answers!
Forum: Fixing WordPress
In reply to: Stripping shortcodes, keeping the contentThis solution does not strip the shortcode tags. It displays the first 55 characters of the whole content (the shortcodes being displayed as text).
Forum: Fixing WordPress
In reply to: Stripping shortcodes, keeping the contentApparently, remove_shortcode() only deletes the hook, ie. the shortcode text is displayed, but does not activate the function.
Forum: Fixing WordPress
In reply to: Stripping shortcodes, keeping the contentKind of similar problem, if adding a shortcode inside these shortcodes tags, the inner shortcode won’t trigger the shortcode activation.
For instance,
[one-half][youtube=https://www.youtube.com?watch=xxxxxx][/one-half]
will display the text “[youtube=https://www.youtube.com?watch=xxxxxx]” in the html column.
Forum: Fixing WordPress
In reply to: Stripping shortcodes, keeping the contentYup. It gives the same result. All content between opening and closing tags [shortcode]content[/shortcode] is deleted…