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

How to maintain W3C standards compliance of a theme

Correction, your theme was still compliant with XHTML 1.1 and CSS 2.1, but the plug-ins you added injected additional code that wasn’t compliant. Unfortunately, there’s no easy way to maintain compliance if you’re using plug-ins. The best you can do is validate your theme and all of the markup you are personally responsible for, then … 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

Starter Theme vs Parent Theme? Pros and cons

I totally agree with Rarst. I just want to add some small things. Note: I differentiate parent theme and framework. In my answer, I consider parent theme like TwentyEleven where it’s mainly created for a specific website and less hooks than a framework. Starter theme: Pros Easy to customize at HTML level. I mean something … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)