Theme Customizer – Dynamic CSS PHP File

@s_ha_dum is right, the ajax plugin api is the way to go. I ran into this issue myself with a dynamic js file I was generating a little while ago. Basically you would enqueue your style as follows: wp_enqueue_style( ‘dynamic-css’, admin_url(‘admin-ajax.php’).’?action=dynamic_css’, $deps, $ver, $media ); Then create a function to load your dynamic css file: … Read more

Convert a static website to a WordPress theme and import all existing content

WordPress has a perfect wrapper for HTML > Theme conversion: The theme itself. All information can be found in the Codex page. It is enough to add a folder to your wp-content/themes directory (or whatever directory you registered in addition to that), and add the following files functions.php style.css index.php header.php to your custom themename … Read more

CSS stylesheet not loading

I have tried to create WordPress theme using your functions.php, style.css and index.php and for me, the stylesheet is loading correctly. Please make sure you have added your header.php and footer.php for the theme. Please study some tutorials for theme development on WordPress.You can look at this link https://codex.wordpress.org/Theme_Development for detailed information.

Add classname to the_category() function?

First locate the_category() in the Codex. Scroll down to the bottom of the page to “Source Code”. There is a link “the_categfory() is located in …”. Click the link, you will be redirected to the source code. Alternativly open the file wp-includes/category-template.php in your IDE or editor. Now search for function the_category(). You will see … Read more

Style.css in child theme is loaded before Bootstrap

Mostly the parent theme might be enqueing the child theme’s style.css, if so you can dequeue it by using handle and then enqueue with proper dependency. If the child theme’s handle is child-theme-style, then dequeue it using wp_dequeue_style(‘child-theme-style’) then enqueue it as needed like so. wp_enqueue_style(‘child-theme-dep’,get_stylesheet_uri(),array(‘bootstrap-handle-here’)) We can easily know the child theme stylesheet url … Read more

How do I add a class to that is generated by >

You can add to the function simply by placing the desired class as the first parameter like so body_class(‘class-name’). If you’d like a little more flexibility you can hook into it using add_filter(‘body_class’,’my_class_names’). You can read more here.