I am using the Members plugin for the first time, and it is awesome.
The only downside that I have found thus far is in the documentation.
Below I outline how to use the plugin’s functionality in a custom WordPress page template to restrict the contents to a certain role.
Step 1: Install and activate the plugin.
Step 2: Create a role. In our case, we will call the role, “Staff”.
Step 3: Create a capability for that role. In our case, we will create a capability called, “view_staff_member_pages”.
Step 4: Add a user to the “Staff” role.
Step 5: Insert the following code into your template file:
Login to view this content.'; } } ?>
That’s it! I hope this helps.
More posts from themightymo.com
How to fix the “Warning: Class ‘Automattic\WooCommerce\StoreApi\Routes” issue in WordPress + WooCommerce
Today when I visited a customer’s website, I saw an error similar to this: etc. After trying all sorts of troubleshooting, the solution ended up being simple. Download a fresh copy of WooCommerce from WordPress.org and FTP it up to the server, replacing the existing WooCommerce files. Problem solved. Isn’t that nice? Many thanks to…
Here’s a bit of plain CSS that’ll create rainbow text on your WordPress site or anywhere, really.
I ran into a rather serious issue recently: a human on my team (me) intentionally (but accidentally) deleted an Amazon S3 bucket that was serving files to a WordPress site. The solution to the problem follows: Cry when you realize you cannot restore a deleted S3 bucket. Search your computer, your co-workers’ computers, your former…