Restrict product tags archive to certain users

You could setup a redirect at the top of the archive page template for users that don’t match your criteria, something like: $user = wp_get_current_user(); $allowed = array( ‘editor’, ‘administrator’ ); $redirect_url=”https://url-to-redirect-to”; if ( ! $user || ! array_intersect( $allowed, $user->roles ) ) { wp_safe_redirect( $redirect_url, 401 ); exit; } The check for $allowed and … Read more

How to access specific product id on other pages/posts?

Thanks the Tony Djukic coment, here is a working code example: <?PHP $product_id = 92; /*hard code the product id */ $manufacture_url = get_field( “manufacture_url”, $product_id, true ); echo ‘some html’ + $manufacture_url + ‘some html’ ?> The product ID can be found in the product URL on editing mode. I used xyz PHP plugin … Read more