admin管理员组文章数量:1026182
i called wordpress function between the shorcodes as a input.
<?php echo do_shortcode('[shortcode]'.$var.'[/shortcode]');?>
how to add div class for the $var here?
I tried few combination but it works for the full shortcode. i just want to use the div only for $var.
I tried like,
<?php echo '<div class="own">', do_shortcode( '[shortcode]'.$var.'[/shortcode]'), '</div>' ; ?>
How to add div class only for $var here?
i called wordpress function between the shorcodes as a input.
<?php echo do_shortcode('[shortcode]'.$var.'[/shortcode]');?>
how to add div class for the $var here?
I tried few combination but it works for the full shortcode. i just want to use the div only for $var.
I tried like,
<?php echo '<div class="own">', do_shortcode( '[shortcode]'.$var.'[/shortcode]'), '</div>' ; ?>
How to add div class only for $var here?
Share Improve this question edited Apr 2, 2019 at 5:32 fuxia♦ 107k39 gold badges255 silver badges459 bronze badges asked Apr 1, 2019 at 16:15 Ramkumar MRamkumar M 8741 gold badge13 silver badges33 bronze badges2 Answers
Reset to default 4It's a bit difficult to understand or provide an accurate answer as we don't know what the shortcode is executing. Is it stripping html or any other parsing?
If this is your own code, then you could add it in the function the shortcode is calling.
If its not you could try a couple options:
1: (adding the div directly into the shortcode call)
<?php echo do_shortcode( '[shortcode]<div>'.$var.'</div>[/shortcode]'), ; ?>
2: add it to the $var
first:
<?php
$dvar = '<div class="own">'.$var.'</div>';
echo do_shortcode('[shortcode]'.$dvar.'[/shortcode]');
?>
Again, the ideal solution would be to see that function and then put the div directly in before the shortcode is executed.
How to add div class only for $var here?
Try this
<?php
echo do_shortcode( '[shortcode]<div class="own">'.$var.'</div>[/shortcode]'), ;
?>
i called wordpress function between the shorcodes as a input.
<?php echo do_shortcode('[shortcode]'.$var.'[/shortcode]');?>
how to add div class for the $var here?
I tried few combination but it works for the full shortcode. i just want to use the div only for $var.
I tried like,
<?php echo '<div class="own">', do_shortcode( '[shortcode]'.$var.'[/shortcode]'), '</div>' ; ?>
How to add div class only for $var here?
i called wordpress function between the shorcodes as a input.
<?php echo do_shortcode('[shortcode]'.$var.'[/shortcode]');?>
how to add div class for the $var here?
I tried few combination but it works for the full shortcode. i just want to use the div only for $var.
I tried like,
<?php echo '<div class="own">', do_shortcode( '[shortcode]'.$var.'[/shortcode]'), '</div>' ; ?>
How to add div class only for $var here?
Share Improve this question edited Apr 2, 2019 at 5:32 fuxia♦ 107k39 gold badges255 silver badges459 bronze badges asked Apr 1, 2019 at 16:15 Ramkumar MRamkumar M 8741 gold badge13 silver badges33 bronze badges2 Answers
Reset to default 4It's a bit difficult to understand or provide an accurate answer as we don't know what the shortcode is executing. Is it stripping html or any other parsing?
If this is your own code, then you could add it in the function the shortcode is calling.
If its not you could try a couple options:
1: (adding the div directly into the shortcode call)
<?php echo do_shortcode( '[shortcode]<div>'.$var.'</div>[/shortcode]'), ; ?>
2: add it to the $var
first:
<?php
$dvar = '<div class="own">'.$var.'</div>';
echo do_shortcode('[shortcode]'.$dvar.'[/shortcode]');
?>
Again, the ideal solution would be to see that function and then put the div directly in before the shortcode is executed.
How to add div class only for $var here?
Try this
<?php
echo do_shortcode( '[shortcode]<div class="own">'.$var.'</div>[/shortcode]'), ;
?>
本文标签: How to use div class between the shortcode variable
版权声明:本文标题:How to use div class between the shortcode variable? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745636900a2160506.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论