Dear Support,
I have a Flex Grid on the front page that I would like to hide from logged out users (and in stead show a text field for logged out users). It is filled with courses, but you need to be logged in to enter the course. Is there a way to show / hide Grids for logged in / logged out users?
Hello @jaapnr1 !
In order to avoid misunderstandings, please provide more information(screenshots/video) about what exactly you need to achieve or what is the issue there and your website link.
A solution for sending a screenshot/video is this:
Download, capture, and send: https://www.techsmith.com/jing-tool.html
After making the screenshot, you will have a link; paste it here.
Thank you!
Dear Bettina,
Thank you for the quick answer. The website in question is https://alpha-audio.net. At the bottom I uses a Grid to show some courses: Screenshot
This Grid needs to be hidden for logged-out users. They need to see a text-message with a link to log-in.
I hope this helps!
-
This reply was modified 3 years by
jaapnr1.
Same issue here..
I added this code in my child theme functions.php so that I can hide the registration button when the user has already logged in but to no avail.
add_action( ‘wp_enqueue_scripts’, ‘theme_enqueue_styles’, 11);
function theme_enqueue_styles() {
wp_enqueue_style(‘td-theme’, get_template_directory_uri() . ‘/style.css’, ”, TD_THEME_VERSION, ‘all’ );
wp_enqueue_style(‘td-theme-child’, get_stylesheet_directory_uri() . ‘/style.css’, array(‘td-theme’), TD_THEME_VERSION . ‘c’, ‘all’ );
}
function hide_element_for_logged_in_users() {
if ( is_user_logged_in() ) {
// Enqueue inline CSS
wp_add_inline_style( ‘td-theme-child’, ‘.registration { display: none !important; }’ );
}
}
add_action( ‘wp_enqueue_scripts’, ‘hide_element_for_logged_in_users’ );