I assume you mean on the front end;
<?php
if (is_user_logged_in()) {
// Only visible when logged in
} else {
// Only visible when not logged in
}
?>
Related Posts:
- How to restrict a page [without plugin]
- Restrict access to specific users
- Hide posts of particular category for everyone except of particular user group or role
- How prevent direct access to PDF file
- How restrict video to be open on direct url hit
- Disable Page if user not logged in
- Learndash groups content protection with tags
- How can i restrict a page to certain user roles?
- Segregating content in a blog for 2 different readers
- Restrict directory listing to only logged in users
- Restrict content even to specific user
- Member Site – Always Sends Me Back To Login
- I want to restrict a page for subscriber and contributor
- How to stop EU users from accessing my website?
- How to restrict attachment download to a specific user?
- Correct Post Count ( All | Published | Drafts | Pending | Trash ) for Custom Post Type when restricting to view own posts
- User redirect to destination URL after login
- Create a USERNAME and PASSWORD protected WordPress page
- Restrict post edit/delete based on user ID and custom field
- How do I display a user specific content?
- How can I limit functionality in one version of a plugin?
- Hiding posts from non logged in users
- how to make author to write comment on only his own posts?
- setting a specific home page for logged in users
- Restrict the user access in multi site for non-assigned blogs
- Restrict access to the Trash folder in Posts
- Restrict backend but allow to use post.php?action=delete&post=POSTID from front-end
- Removing WordPress Plugin Menu Item for a specific user
- Allow access on a page to just only a specific member
- Restrict PDF links
- Limit REST API output to current logged in user that is also author of the content
- WordPress stripping html and script tags from some admin users on save
- Taxonomies, restrict editing and creation of terms?
- Hide everything on site for visitors except specific page IDs
- Restrict Login Subscriber users from accessing frontend
- Restrict other Admins from using Editor in Admin Panel
- How to restrict the editors from viewing/editing pages created by admin?
- Restrict uploaded files into a custom folder to logged in users by htaccess: looking for Nginx – not only Apache – solution
- Redirect user to login before viewing custom post
- not logged in users can’t submit form
- Protect sequence of pages with same password for each of two groups of users
- How can I restrict image upload dimensions for non-admin WordPress users?
- How to restrict logged user to view only certain pages?
- Limit post display to post authors and create an exception for specific pages
- Use an activation code to change a role [closed]
- Restrict certain character combinations in username during registration
- How to show post content before read more tag (excerpt) for password protected posts?
- How do I log out users from a restricted page if they are already logged in on another device? [closed]
- Restrict access to content in conjunction with facebook connect & google login
- Remove admin menu
- How to properly print a 404 error without redirecton? (i.e. keeping the current URL)
- How to allow registered users to submit the form only 5 times per day?
- Restrict content based on buy woocommerce product
- User restricted only show posts assigned to current user
- How to force acceptance of site terms on first login?
- One Site as a part of Multisite to be hidden (Un-published) from Public?
- Restricting page access [closed]
- Restrict access to trash, only admin
- Downloadable content only for subscribers?
- Hide front-end from every logged out user and redirect them to the default login page
- Restrict the list of parent pages to only those which are created by current user
- How to restrict an admin page, if the user is not superadmin?
- Should I setup frontend-only users as CPT or use a plug-in?
- How to restrict access to a single for users I’ve authorized? [closed]
- Requiring login for specific pages
- How can I lock specific posts (cpt’s) from editing by anyone other than ADMINS
- How can I restrict a custom WordPress role access to only a specific plugin?
- Is it possible to restrict files from your wordpress uploads (not logged-in users or guest)?
- Require re-login when logged-in user attempts to access restricted page
- force login loophole
- Simple Math Quiz or Captcha to hide whois query form
- How to restrict a plugin from certain pages without editing its core
- Is there a way to create folders restricted to specific users to open?
- Show content if user left comment / non-logged visitors?
- How can I fetch user registration age
- How to show private pages based on a user’s role?
- How to block access to a folder inside of wp-content for non logged in users?
- Hide top admin panel for non admin and non editors
- How to use url formatter with integer
- Restricted images only for logged user. (hidden url)
- Multiple domains, Single database, 1 Parent/Master with all content, other domains/slaves with filtered content (based on “location” variable)
- Using a page-template to restrict access based on IP (Frontend)
- Restrict access to custom post type and filter from every query
- Allow users to only CREATE one single (custom) post
- Front end login and page restriction
- WordPress Shop and restricting products and categories for some users/groups
- Assign specific editor with custom user meta “A” to all authors with custom user meta “A” and exclude all other author access
- Hide page link in main menu from anonymous users
- Restrict access to specific content
- Restrict download files from not generated Urls
- Avoid too long words in a post title, post content or comment but only if its not a url
- Basic File/Post restriction plugin
- How do I protect my uploads?
- Premium Members Section of website
- How can visitors redirect wp-admin to the homepage?
- Using Conditional Tags to restrict something to 1 user?
- Website visible only to Registered users (non wp-admin)
- Multisite Login Access Restrictions
- Restrict Image Sizes and Dimensions when Uploading via the WP Mobile App
- Hide custom posts from certain taxonomy in rest api