wordpress实现文章对游客不可见,对会员可见的方法及代码。

 

<?php
if ( is_user_logged_in() )
{
echo ‘<span class=”tag”>’;
$user = the_field(“price”);
echo ‘<span class=”small”>元</span></span>’;
}

else {
echo ‘<span class=”tag”><span style=”font-size:0.8em;”>查看价格</span></span>’;
}
?>


4541293 微信咨询