How to get the current scroll top position?
How to get the current scroll top position? Copy and past the following codes below to your JS file.
var current_scroll = window.scrollY; console.log( current_scroll );
Where ‘style-woocommerce’ is the ID of your stylesheet and get_stylesheet_directory_uri().’/style-woocommerce.css’ is your .css DIR. wp_register_style( 'style-woocommerce', get_stylesheet_directory_uri().'/style-woocommerce.css' ); wp_enqueue_style( 'style-woocommerce' ); Function below is for woocommerce page css only. This will show on woocommerce pages else is not. add_action( 'wp_enqueue_scripts','home_scripts' ); function home_scripts(){ If( is_shop() || is_product_category() || is_product() ){ wp_register_style( 'style-woocommerce', get_stylesheet_directory_uri().'/style-woocommerce.css' ); wp_enqueue_style(…
function tml_title( $title, $action ) { if ( is_user_logged_in() ) { $user = wp_get_current_user; if ( ‘profile’ == $action ) $title = ‘Your Profile’; else $title = sprintf( ‘Welcome, %s’, $user->display_name ); } else { switch ( $action ) { case ‘register’ : $title = ‘Sign Up’; break; case ‘lostpassword’: case ‘retrievepassword’: case ‘resetpass’: case…
Hi guys, having a hard time looking a codes online on how to create a WordPress customize settings? I guess, your not alone. But for me, I’m done on it and converted already into a tutorial. I’m hoping to help someone with this kind of problem. I have a tutorials below on how to create…
WordPress media library upload restriction, just copy the code below to your functions.php Or install this plugin to do the task WDES User Upload Restriction – https://wordpress.org/plugins/wdes-user-upload-restriction/. add_action(‘pre_get_posts’,’wdes_users_own_attachments’); function wdes_users_own_attachments( $wp_query_obj ) { global $current_user, $pagenow; if( !is_a( $current_user, ‘WP_User’) ){ return; } if( !in_array( $pagenow, array( ‘upload.php’, ‘admin-ajax.php’ ) ) ){ return; } if(…
Page Settings In every popup created, each of them has a dedicated page settings that applies only that specific popup. You can setup an awesome popup using this features. [wdes-popup-title id=”1603″ class=”button”] Shortcode attributes Popup Title Shortcode attributes id – (required) This is your popup ID, without this, the popup will not work. class –…