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 );
How check if current user has pmpro_hasMembershipLevel? Copy and paste the code below to your custom template. // $levelID is can be name or ID of the membership level // $userID is the ID of the current user pmpro_hasMembershipLevel( $levelID, $userID ); // Example if(pmpro_hasMembershipLevel('12')){ } if(pmpro_hasMembershipLevel('Gold')){ } if(pmpro_hasMembershipLevel(array('12','14','Gold'))){ }
This plugin hasn’t been tested with the latest major releases of WordPress is showed up to my WordPress plugin after I did not update my WordPress plugins for a year I think or months and many WordPress version is released after that. This is the exact notice message displayed: This plugin hasn’t been tested with…
<ul> <li>Lorem</li> <li>Lorem ipsum immit</li> <li>Lorem dolor</li> </ul> // GET THE WIDTH HIGHEST VALUE var max = Math.max.apply(Math, jQuery("ul li").map(function() { return jQuery(this).width(); })); jQuery( 'ul' ).css( {'max-width': max, 'width':'100%'} ); // GET THE HEIGHT HIGHEST VALUE var max_height = Math.max.apply( Math, jQuery( 'ul li' ).map( function(){ return jQuery( this ).height(); }) ); jQuery( 'ul'…
Add Woocommerce product category image using GeneratePress WordPress theme in few steps. You need to access your functions.php. Either on a parent theme or a child theme. In my case I’m using a child theme so gonna paste the codes below on child themes functions.php Please copy the code below and paste it into your…
Customize rtmedia gallery ( media-gallery-item.php ) with additional display like image, audio, video, etc. Are you having a problem adding custom information on the media gallery item? You don’t have to worry now, the codes below is the solution. In my example, I want to add an audio player and the same time this is…
How to change group avatar thumbnail? <?php bp_group_avatar_thumb() ?> // Usage bp_group_avatar( 'type=thumb&width=50&height=50' ); // Original codes function bp_group_avatar( $args = '' ) { echo bp_get_group_avatar( $args ); } function bp_get_group_avatar( $args = '' ) { global $groups_template; // Bail if avatars are turned off. if ( bp_disable_group_avatar_uploads() || ! buddypress()->avatar->show_avatars ) { return false;…