WordPress codex for page
How to get the current page slug?
global $post; $slug = get_post( $post )->post_name;
How to add rtMedia custom settings just like the example image above? Just add the codes to your functions.php of your theme. add_filter( 'rtmedia_add_settings_sub_tabs', 'wdes_music_rtmedia_pro_settings_tabs_content' ); function wdes_music_rtmedia_pro_settings_tabs_content( $tabs ){ $tabs[] = array( 'href' => '#rtmedia-music-genre', 'icon' => 'dashicons-admin-tools', 'title' => esc_html__( 'Music Genre' ), 'name' => esc_html__( 'Music Genre' ), 'callback' => 'wdes_music_genre_settings_callback', );…
How to check if there is an ajax running on your page? Here’s a code below that can help you figure it out. jQuery( document ).ready(function($) { $(document).ajaxStart( function() { console.log('ajax true' ); }).ajaxStop( function() { console.log('ajax false' ); }); });
Paste the following css to your style.css .ngg-gallery-thumbnail-box { margin: 5px .5%!important; width: 32.3%!important; } .ngg-gallery-thumbnail a { display: block; overflow: hidden; } .ngg-gallery-thumbnail a img { border: 1px solid #8eb83b!important; width: 95%!important; padding: 2%!important; margin: 0 auto!important; }
How to make video iframe responive? Copy the CSS below and make sure that there is a ” iframe-wrap ” before the iframe element. CSS .iframe-wrap { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .iframe-wrap iframe, .iframe-wrap object, .iframe-wrap embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%;…
Update via wp-config.php define('WP_HOME', 'http://www.example.local'); define('WP_SITEURL', 'http://www.example.local'); Update via functions.php update_option('siteurl','http://www.example.local'); update_option('home','http://www.example.local');
How to replace Woocommerce placeholder image URL? Just copy the codes below. add_filter( 'woocommerce_placeholder_img_src', function( $classes ){ if( !is_product() ) return; // this code is intended to single product only. Remove this for general changes. return get_bloginfo( 'url' ) . '/wp-content/uploads/2016/03/placeholder.jpg'; } );