Only registered users can see part of the contents of single.php

If you only want logged in users to be able to see a part of your code you need two things:

  • a standard if statement
  • A function to test is a user is logged in or not aka is_user_logged_in()

Note that if a user is not logged in there is no way to know if they are or aren’t registered.

Additionally, you can’t cache your site for logged in users if you do this or the parts you’re hiding will be cached and shown to logged out users. You also won’t be able to serve cached pages to logged in users or they’ll be unable to see the parts of the page you hid

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)