WordPress codex for page
How to get the current page slug?
global $post; $slug = get_post( $post )->post_name;
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’))){ }
How to get the current post parent category ID? Just copy the codes below and paste this your template. global $post; $category = get_the_category( get_the_ID() ); $parent = $category[0]->term_id
WDES Responsive Tool 2 is a WordPress plug-in designed to provide mobile responsive solution for your websites. WDES Responsive Tool 2 helps your websites mobile friendly and much more reliable in mobile view.
How to check radio button if checked or not? if( $("input#myradio-id").is(":checked") ){ // IF CHECKED CODES }else{ // IF NOT CHECKED CODES } Navigation menu on-click prevent default if menu item has children and fires only on second click // OPTION 1 // JQUERY $( ‘.menu-item-has-children a’ ).click( function(e){ $( this ).parent().toggleClass( ‘active-li’ ); if(…
var iframe_url = ‘http://www.wala.com/’; var cacheParamValue = (new Date()).getTime() * 1000; var url = iframe_url + "?cache=" + cacheParamValue; jQuery( ‘iframe’ ).attr( ‘src’, url ); Output: <iframe width="100%" height="99%" src="http://www.wala.com/?cache=1406685294271000"></iframe>
If you want to create a drop-down menu, I have a sample codes below. It is very simple but will put your mobile much user friendly. It’s up to you on how you design the layout. I’d like to recommend to use WDES Responsive Mobile Menu if you want your mobile views won’t take so…