Hello @mlapl1,
Thanks for posting.
Our shortcode is documented in the plugin’s readme page. Scroll down to the SHORTCODE section of the page.
https://wordpress.org/plugins/content-control/
So, the shortcode is great for restricting parts of the main content on a post or page.
Here are a couple of examples:
1) [content_control roles="administrator" message="Sorry. You need to be an <strong>admin</strong> to see this part of the content."]ADMIN CONTENT GOES HERE[/content_control]
2) [content_control roles="administrator,subscriber" message="Sorry. You need to a <strong>subscriber</strong> or <strong>admin</strong> to see this part of the content."]SUBSCRIBER AND ADMIN CONTENT GOES HERE[/content_control]
Here’s what a non logged-in visitor would see using those 2 shortcode examples.
https://jmp.sh/fNMB1B2
Here’s a screengrab of the source code for that page.
https://jmp.sh/8oltK1R
We hope that helps. Let us know if you need anything else.
Have a great day 🙂
Mark
Thread Starter
mlapl1
(@mlapl1)
Hello and Thank you Mark.
Just before writing, I copied and pasted exactly the first of the two code snippets above, but with no effect. I wonder if there is a plugin conflict… I was also wondering whether there was any way of generating the shortcode from the content_control “Add a Restriction” system. So, what you are saying is that I can simply write the shortcode and not bother with the Add a Restriction system.
Thanks a lot
Andrew
Sometimes, copying/pasting quotes messes things up.
Try typing the shortcode from scratch. Then, delete the copied/pasted version.
Also, make sure you’re purging your caches and testing using a private/incognito browser window.
Lastly, if you suspect a plugin conflict:
1) Check your browser’s console log for JS errors. Reference https://wordpress.org/support/article/using-your-browser-to-diagnose-javascript-errors/#chrome
2) Install the WordPress troubleshooting plugin https://wordpress.org/plugins/health-check/. Then, while still on the plugins admin page, click Troubleshoot underneath the Content Control plugin.
What that does is enable only the Content Control plugin. So, if there are no errors and everything works as expected, there was probably a conflict with one of the plugins that’s disabled by the troubleshooting plugin.
To find out which one, reactivate each of the other plugins 1-by-1 and test each time. When the issue comes back, the last plugin you reactivated is the culprit. Notify the plugin developer for help.
Does all that make sense?
If none of those things work, we may need to get access to check your setup. If so, please use our contact form here.
https://code-atlantic.com/contact-us/
Thanks!
Mark
-
This reply was modified 4 years, 10 months ago by
mark l chaves. Reason: Typo
Hello @mlapl1,
We’re going to mark this thread as resolved since we haven’t heard back from you.
Please feel free to start a new thread or submit a help request 🙂
https://code-atlantic.com/contact-us/
Have a great day!
Mark