Blog Archives

Load Bootstrap 4 CSS And JS From MaxCDN – The Right Way

Add this to the functions.php of the active theme. /** * Load Bootstrap CSS and JS from MaxCDN – the right way * * @refer https://millionclues.com/wordpress-tips/load-css-and-js-the-right-way/ */ function mcabl1226_load_css_and_js() { // Load Boostrap CSS wp_enqueue_style( ‘bootstrap-css’, ‘https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css’ ); // Load

Posted in WordPress Tagged with: ,

Translate WordPress Programmatically With Gettext (Without .PO/.MO)

Add this to the functions.php of your theme. This example is to be used with my Ask Me Anything (Anonymously) WordPress plugin. To use it with other themes and plugins, change the text domain of the theme or plugin in

Posted in WordPress Tagged with: ,

Identify Mobile / Tablet / Desktop Using Screen-size in CSS

Add these to your CSS stylesheet as necessary. CSS to be used only on Mobile devices This CSS will be used when the screen width is less than 576px. @media screen and (max-width: 576px) {   .selector {     property: value;   }

Posted in WordPress Tagged with: ,

Hidden Background Music Using HTML5 Audio

Add this to the footer of your page before the closing </body> <audio style="display:none;" src="<?php echo CPM_BASE_PATH; ?>assets/audio/bg-music.mp3" loop autoplay></audio> For more details, refer the HTML5 Audio guide.

Posted in WordPress Tagged with:

Enable Debug Logging In WordPress

Add this to wp-config.php define(‘WP_DEBUG’, true);    // Enable WP_DEBUG mode define( ‘WP_DEBUG_DISPLAY’, false );  // Hide errors from browser. Set to true if you want to see errors in browsers as well. define( ‘WP_DEBUG_LOG’, true );  // Enable Debug logging to the /wp-content/debug.log

Posted in WordPress Tagged with: