Best way to include Bootstrap in WordPress

You can add bootstrap in WordPress by following function in functions.php You can change url as you need if you have cdn. <?php /** * Enqueue scripts and styles */ function your_theme_enqueue_scripts() { // all styles wp_enqueue_style( ‘bootstrap’, get_stylesheet_directory_uri() . ‘/css/bootstrap.css’, array(), 20141119 ); wp_enqueue_style( ‘theme-style’, get_stylesheet_directory_uri() . ‘/css/style.css’, array(), 20141119 ); // all scripts … Read more

How to move page template files like page-{slug}.php to a sub-directory?

How Page Templates are loaded: According to the default WordPress Template Hierarchy, a page request loads a template based on the priority and naming as stated below: Custom Page Template: if defined in the page editor. page-{slug}.php page-{url-encoded-slug}.php: only for multi-byte characters. page-{id}.php page.php singular.php index.php Among these, singular.php and index.php are not actually page … Read more

W3 Total Cache, CDN and theme files [closed]

You need to either Version your files (by calling it style.css?ver=xxx.xxx) and making sure your CloudFront distribution has “Forward Query strings” turned on. This is the better option, as it means that all you need to do is increment the number in the query string and CloudFront will fetch this file automatically. Manually invalidate your … Read more