Restrict access if logged out except for homepage
Is your “home page” displaying a list of the site’s blog posts, or is it set to display a specific page? If the latter, you need to use is_front_page() instead of is_home().
Is your “home page” displaying a list of the site’s blog posts, or is it set to display a specific page? If the latter, you need to use is_front_page() instead of is_home().
Solved the above task, posting the answer here so that someone can use the code I added this code in functions.php function is_user_video_perweek( $reg_days_ago ) { $currentuser = wp_get_current_user(); return ( isset( $currentuser->data->user_registered ) && strtotime( $currentuser->data->user_registered ) < strtotime( sprintf( ‘-%d days’, $reg_days_ago ) ) ); } and then in footer.php I called this … Read more
Welcome to Stack Exchange! What you need is a paywall plugin or a membership plugin that will require the visitor to pay or be a member to view your news content. Check out these plugins: Restrict User Access https://wordpress.org/plugins/restrict-user-access/ Leaky Paywall https://wordpress.org/plugins/leaky-paywall/ Good Luck!
This is a rudimentary (untested) version of the code that I can think will resolve your issue: <?php /** * Redirect UnAuthorized Users from my page. * * Users will be redirected to another page if not authorized. */ function wpse375662_redirect_unauth_users() { // Not that particular page – bail out. if ( ! is_page( $page_id … Read more
URL Restrictions? Need only people who are logged in AND have a specific role (or roles) to access all pages for a site
Add this code in your Functions.php. This code help you to show user only their own uploads but admin can see all media uploaded by other users and this code is tested on current wordpress Version 5.8 // Limit media library access add_filter( ‘ajax_query_attachments_args’, ‘wpb_show_current_user_attachments’ ); function wpb_show_current_user_attachments( $query ) { $user_id = get_current_user_id(); if … Read more
create a custom query for posts managed by Restrict Content Pro
can you help review CCCP (Conditional Cookie Content Post) and help to create a block?
Show content if user left comment / non-logged visitors?
Uploading attachment (pdf) and prevent download for anonymous user