Hallo, I hope you can help me with this question!
I’m using Xstore to sell courses; I would like to use publish data as the course data in order to take benefit to data course sorting.
I achieved it by using the following rule in the function.php but it works only if I am logged in as admin. I would like it to work also in public view (no-loggedin), I tried to modify the script without any results…maybe you can help me or you can put me in the right way, it will be very helpfull.
I’ve attached an imag to better show
Thanks in advance
Graz
Shop page https://sviluppomanageriale.it/develop13/shop/
add_action(‘woocommerce_product_query’, ‘show_future_products’, 999);
function show_future_products($q)
{
if ( ! is_admin() && ! is_user_logged_in() ) {
$q->set(‘post_status’, array(‘publish’, ‘future’));
}
}