i've found the following code to make an element change to display:block; if a user is logged in

```
.logged-in .price{
 display: none;
 }

```

and also

```
<?php if ( is_user_logged_in() ) {
echo '<style>p.price {display:none;}</style>';
} else {
echo '<style>p.price {display:block;}</style>';
}
?>

```

but neither seems to work properly. it will hide the element, but if i log out, the element is still hidden. does anyone have an answer? thankyou :)