Nic Winn
Forum Replies Created
-
Forum: Plugins
In reply to: [Breadcrumb NavXT] Import ignores “bmainsite_display”: falseCurious if you get the same results.
We have the plugin Network Activated in a Multisite environment if that matters.{
"plugin": "Breadcrumb NavXT",
"version": "7.4.1",
"settings": {
"bmainsite_display": false,Forum: Plugins
In reply to: [Code Snippets] Multisite Activation (Feature Request)@bungeshea where would that exclusion code be added? Is there a code example you can point to?
ThanksForum: Plugins
In reply to: [Code Snippets] Restrict content for visitorsTo clarify, the brackets
[ ]and their contents should not be used.replace with something more along the lines of php like
get_template_part('template-parts/item-details');So that would be:
if ( is_user_logged_in() ) { get_template_part('template-parts/item-details'); } else { echo '<a href="/wp-login.php">Login</a> to see details.'; }- This reply was modified 5 years, 3 months ago by Nic Winn.
Forum: Plugins
In reply to: [Code Snippets] Restrict content for visitors@alanfrys, If you aren’t concerned with what role the user has (basic roles:administrator, editor, author, subscriber) but only if the user is logged in (which is typically a subscriber) then try the … wait for it … is_user_logged_in() function.
Example:
if ( is_user_logged_in() ) { [ whatever template part is used to get these elements: <span class="details"></span> <span class="details"></span> <span class="details"></span> <span class="details"></span> <div class="woocommerce-product-details__short-description"></div> ] } else { echo '<a href="/wp-login.php">Login</a> to see details.'; }Hope that helps.