我正在使用此插件 https://wordpress.org/plugins/content-protector/
受密码保护的内容
输入正确的密码以查看内容
[passster password="123456"]Your content here[/passster]
我不知道如何在php中使用短代码
<!--<hide content>-->
<ul class="TPlayerNv">
<?php echo $optplayer; ?>
</ul>
<div class="TPlayerCn BgA">
<div class="EcBgA" style="background-color:#EEEEEE!important;">
<div class="TPlayer">
<?php echo $player; ?>
<span class="AAIco-lightbulb_outline lgtbx-lnk"></span>
</div>
</div>
</div>
<span class="lgtbx"></span>
<!--</hide content>-->
答案 0 :(得分:0)
下面给出了在任何PHP文件中调用简码的常规方法:
<?php
echo do_shortcode('[passster password="123456"]Your content here[/passster]');
?>
希望它可以帮助您获得所需的输出。请检查。
答案 1 :(得分:0)
在wordpress中编写简码,请检查以下链接。
https://developer.wordpress.org/reference/functions/do_shortcode/
<?php echo do_shortcode('[name_of_shortcode]'); ?>
答案 2 :(得分:0)
<?php
echo do_shortcode('[passster password="123456"]
<!--<hide content>-->
<ul class="TPlayerNv">
<?php echo $optplayer; ?>
</ul>
<div class="TPlayerCn BgA">
<div class="EcBgA" style="background-color:#EEEEEE!important;">
<div class="TPlayer">
<?php echo $player; ?>
<span class="AAIco-lightbulb_outline lgtbx-lnk"></span>
</div>
</div>
</div>
<span class="lgtbx"></span>
<!--</hide content>-->
[/passster]');
?>
但是我需要隐藏内容
他不能工作