mercredi 25 février 2015

"if is logged in" doesn't work for me


Im trying to achieve the code hides part of the content from unregistered users but doesn't work for me and comes back with error this is the code i tried



if ( is_user_logged_in() ) {
echo '<div class="container_12">
<?php while ( have_posts() ) : the_post(); ?>
<?php woocommerce_get_template_part( 'content', 'single-product' ); ?>
<?php endwhile; // end of the loop. ?>
</div>}
else {
echo 'you must to log in to see the content';}
?>




Aucun commentaire:

Enregistrer un commentaire