Horje
Wordpress skips parsing of shortcode - Wordpress Solution
[Solved] - Wordpress skips parsing of shortcode - Wordpress Solution
Try following codes
Hi, While building a theme i came across the following problem :) I use the following shortcodes to generate a slideshow.

function r2_carousel( $atts, $content = null ) {
return '<ul id="carousel"><li><ul>' .do_shortcode($content). '</ul></li></ul>';
}
add_shortcode('carousel', 'r2_carousel');
	
function r2_carousel_slide( $atts, $content = null ) {
extract(shortcode_atts(array(
'title'      => ''
), $atts));
		
return '<li class="slide"><h1>' .$title. '</h1><p>' .do_shortcode($content). '</p></li>';
}
add_shortcode('slide', 'r2_carousel_slide');
It works up until the parsing of the second slide: Input

[carousel]
[slide title="Using talent: Analyse 1"]Onze experts analyseren uw recruitment proces en organisatie om knelpunten te identificeren.[/slide]
[slide title="Using talen"]ces en organisatie om knelpunten te identificeren.[/slide]
[slide title="Using talent: Analyse 1"]Onze experts analyseren uw recruitment proces en organisatie om knelpunten te identificeren.[/slide]
[/carousel]
Output

<ul id="carousel"><li><ul>
<li class="slide"><h1>Using talent: Analyse 1</h1><p>Onze experts analyseren uw recruitment proces en organisatie om knelpunten te identificeren.</p></li>

[slide title="Using talen"]ces en organisatie om knelpunten te identificeren.[/slide]

<li class="slide"><h1>Using talent: Analyse 1</h1><p>Onze experts analyseren uw recruitment proces en organisatie om knelpunten te identificeren.</p></li></ul></li></ul>
It just skips the second "slide" shortcode and continues as normal afterwards. I'm running wordpress 3.0.1 without any plugins. Thanks in advance. Kind regards, Lars

Solution - 1

Add this to your functions.php:


add_filter('the_content', 'do_shortcode');
That will make wordpress parse shortcodes that are within shortcodes

Date: 2022-10-21 05:20:21
Category: Wordpress
More for You