Tips and tricks
Parsing shortcodes such as this one
[row] [col size="6"]...[/col] [col size="6"] // second col [row] [col size="6"]...[/col] // second col end, wrong [col size="6"]...[/col] [/row] [/col] [/row]
can be tricky because the second [col] is ended by the one nested in the second, nested [row]
so I have found that the best solution is to parse the second [row] first , before the first [row]
just add a the_content filter
add_filter( "the_content", 'parse_content_for_nested_shortcodes' );
and this is the function
function parse_content_for_nested_shortcodes($content){ $matches=array(); $subject = $content; $pattern = '/[row.*?([row.*?].*?[/row])/'; preg_match_all($pattern, $subject, $matches); if(count($matches)>0 && isset($matches[1])){ foreach($matches[1] as $regmatch){ $content = str_replace($regmatch, stripslashes(do_shortcode($regmatch)), $content); } } return $content; }
hello, i’ve bought dzscalendar plugin. I have a problem how to use calendar in header (shortcode not work) ?
i tried to use :
I¡¦m not positive where you are getting your information, however good topic. I needs to spend some time learning much more or working out more. Thanks for excellent info I used to be searching for this information for my mission.
Hey very nice web site!! Man .. Excellent .. Amazing .. its a really great blog post of i enjoyed lot.thanks again for share with us.
I simply want to mention I’m beginner to blogging and really liked this website. Very likely I’m likely to bookmark your site . You surely come with tremendous well written articles. Cheers for sharing your blog site.
Your mode of telling all in this paragraph is genuinely pleasant, all be capable of without difficulty understand it, Thanks a lot.