401

How to Hide Content from Logged Out Users

Powered by WPCodeBox

Assign the ‘hideifloggedout’ CSS class to any element you wish to hide from users that are not logged in. This helps you control content visibility for logged-out users.


/**
 * Author: MyListing Club
 * Author URI: https://mylisting.club
 */
 

/* HIDE CONTENT WHEN LOGGED OUT */
body:not(.logged-in) .hideifloggedout {
    display: none !important;
}

Other Snippets

WPCodeBox is a WordPress Code Snippets Manager that allows you to share your WordPress Code Snippets across your sites.