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 to disable updates in WordPress theme

First of all, it is a very bad idea to modify the original theme without creating a child theme. Disabling updates of such theme is even worse idea, because without updates, your site may get infected or attacked. So the long-term solution would be to: Check the version of modified theme. Download that version from … Read more

Promoting child theme to stand alone

Start with “view source” of rendered HTML and then work backward from that, building a new theme by pulling whatever css, php files and functions from the parent as needed. (footnote – thank you for the pointer to the ‘dust me’ utility, I will check that out).

Override parent theme translation on child theme

I think I found a solution, but before a little Premise load_theme_textdomain() and load_child_theme_textdomain() are basically equal, the only difference is the default path they use: they get the current language (using get_locale()) and add the relative .mo file to the path passed as argument; then they call load_textdomain() passing as argument both the textdomain … Read more

Understanding WordPress child theme custom JS loading

This is the proper way to load a custom javascript in your child theme, wp_localize_script is only necessary if you need to exchange data between JS and PHP (Client and server). function assets() { wp_register_script(‘ajax_filter’, get_stylesheet_directory_uri() . ‘/js/ajax-filter-posts.js’, [‘jquery’], ‘1.0’, false); wp_enqueue_script(‘ajax_filter’); wp_localize_script( ‘ajax_filter’, ‘mdu’, array( ‘nonce’ => wp_create_nonce( ‘mdu’ ), ‘ajax_url’ => admin_url( ‘admin-ajax.php’ … Read more