Advice on redirect to lock site from unauthorized users
The comment by ‘warm_tape’ is correct. Use home_url(), then put a die() after the wp_redirect to ensure that the accessed page will ‘die’ and not interfere with your main page.
The comment by ‘warm_tape’ is correct. Use home_url(), then put a die() after the wp_redirect to ensure that the accessed page will ‘die’ and not interfere with your main page.
An htaccess rule is evaluated before WP is called to get page content. So there is no variable you could use in an htaccess rule to check if a user is logged in. Instead, I’d add to your functions.php file code that would check the is_user_logged_in() result. If not logged in, then use wp_redirect() to … Read more
There are several membership plugins or customer area plugins. MemberPress is an easy one to setup.
These four requirments comes right of the box with wordpress. You don’t need any extra plugin for that. Any user can register – Go to General settings page and enable Anyone can register option by checking checkbox available next to it. They can post product – Assign them a role of author so that they … Read more
All of this can be done with code of course but since you say, “The first part (check if the user is registered / subscribed) is the difficult one for me.” …then your time will be better spent going directly to plugins that allow for similar functionality as described in your question. The first recommendation, … Read more
Source: Chris Lima – Managing a High Performance WordPress Membership Site I should look at caching plugins because it makes things faster, better and worked for you. The problem with that answer is that most caching plugins don’t do much for logged in users. Most sites have is that non-logged in users should get pre-cached … Read more
Your answer is on the codex page link in your question. // Get the member type of user 5412. $member_type = bp_get_member_type( 5412 ); So you could do something like this: $member_type = bp_get_member_type( get_current_user_id() ); if ( $member_type == ‘dog’ ) echo ‘Bark’;
Of course this is possible it would just require some custom coding. This is an open ended question so I’ll give you an open ended answer of how I may go about this. Add phone number field to user contact Use the profile_update hook to store a random code associated with that number Create a … Read more
I would flag post as member_post when it is submitted to database and use this flag to sort them. function wpse_287048_flag_member_post( $post_id ) { if ( wc_memberships_get_user_active_memberships() !== false ) { // Check if user is member update_post_meta( $post_id, ‘member_post’, 1 ); } else { update_post_meta( $post_id, ‘member_post’, 0 ); } } add_action( ‘save_post’, ‘wpse_287048_flag_member_post’ … Read more
There is an error in your echo. You are trying to echo a php opening tag. change your function to: function insert_acf() { echo “<p><div id=’content-creator’>Test</div></p><p>” . get_field(‘organisation_name’) . “</p>”; }; This will solve your first problem.