Hi,
I added a custom JS file on the front. It tweaks some elements and the way sections are displayed.
Some sections, according to their classes, are hidden. Thus, I don’t wait this script to be included when I use cornerstone.
Right now, I’m using this function:
function custom_scripts()
{
wp_register_script(‘custom-script’, get_stylesheet_directory_uri() . ‘/custom.js’, array(), false, true);
if( !is_user_logged_in() ) {
wp_enqueue_script(‘custom-script’);
}else {
wp_dequeue_script(‘custom-script’);
}
}
add_action(‘wp_enqueue_scripts’, ‘custom_scripts’, 99);
I don’t like it too much because the user have to be disconnected to see the website correctly.
I’m looking for another way to do it. Something like !is_cornerstone() …
I can’t play with REQUEST_URI because it’s acting like a frame. The URI is the same than the one on the front, even though it is /pro/ in the URL.
