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 to get paid membership pro membership level ID? Copy the codes below. function get_user_member_level_id( $userid ){ global $wpdb; return $wpdb->get_var( "SELECT membership_id FROM wp_pmpro_memberships_users WHERE user_id = $userid" ); } echo get_user_member_level_id( $userid );
The7 social network share button open new window instead of new tab. Copy the codes below to your JS file. $('.soc-ico a' ).click(function(e){ e.preventDefault(); window.open(this.href, "myWindowName", "width=800, height=600"); });
add_filter( 'the_content', 'hidden_image_before_content' ); function hidden_image_before_content( $content ){ global $post; if ( is_singular('post') && has_post_thumbnail() ){ $content = preg_replace( "/<p>/", '<p class="hide">' . get_the_post_thumbnail($post->ID, 'full') . '</p><p>', $content, 1 ); } return $content; }
3 Columns HTML <div class="one-third first">Column 1</div> <div class="one-third">Column 2</div> <div class="one-third">Column 3</div> CSS .one-third { width: 32%; float: left; margin-left: 2%; } .first { margin-left: 0; } Use the HTML/CSS Column Generator for easy job.
How to solve Jquery on click inside or outside the div element ? Just copy the codes below to your script. $( document ).click( function( e ){ var mde = $( '.my-div-element' ); if( ! mde.is( e.target ) && mde.has( e.target ).length === 0 && mde.length ){ // I'm clicking outside of my div element…
jQuery click event is not working when using .clone() or ajax. You can’t fire a click event after your element is loaded? I found the solutions below. [php] jQuery( document ).ready(function($) { $(document).delegate(“#my-clone-id”, ‘click’, function() { $(this).clone().appendTo( “body” ); }); }); [php]