Building a website on wordpress Trying to make a couple of divs visible to logged in users only. I've set display:none in stylesheet and here is how i'm trying to make it visible to logged in users. Not working though...
<?php
if ( is_user_logged_in() ) {
?>
<script type="text/javascript">
$(document).ready(function(){
$(".single_add_to_cart_button").css('display','block');
$(".add_to_cart_button").css('display','block');
});
</script>
<? } ?>
If anyone can think of other ways- it will be greatly appreciated as well