我有密码
<?php
global $current_user; // Use global
get_currentuserinfo(); // Make sure global is set, if not set it.
if ( ! user_can( $current_user, "subscriber" ) ) // Check user object has not got subscriber role
echo \'<span>if user, can view post content</span>\';
else
echo \'<span>if no user, can not view</span>\';
?>
如何制作
echo \'<span>if user, can view post content</span>\';
=>我尝试过,但没有激活:(
echo \'<span><div class="col-sm-12">
<h2><?php the_title(); ?></h2>
<p>
<a class="btn btn-success">Tồng số chữ : <?php if(function_exists(\'bac_post_word_count\')) { bac_post_word_count(); }?></a>
<a target="_blank" rel="noopener noreferrer" href="<?php
$meta = get_post_meta( get_the_ID(), \'download\' );
if( !empty($meta) ) {
echo $meta[0];
}
?>" class="btn btn-warning"><span class="glyphicon glyphicon-cloud-download"></span> Tải về .docx</a></p>
<?php the_content(); ?>
</div></span>\';