Hello.
I'm using my own child theme.
But it take time to show child theme style after parent style. Especially course page.
So user see parent style(don't want show this) during 0.5 second.
How can i show only child theme style??
Can you please share a demonstration video for that .
For me i was only able to see the issue with the header .
In transparent header it calculates the height of header and ten adjusts padding form the top of the title area .
Hello Alex.
Please refer this.
http://www.hodoogwaja.com/child-theme-style-load/
Because child theme style load later than parent, it looks bad.
How can i fix this?
Plz help me.
I just use 'wp_dequeue_style' to remove their style and 'wp_enqueue_style' to add my own earlier in the queue. See if that works for you.
Hello urdek.
Thank you for answer.
But if use 'wp-dequeue-style', site look mass becaouse parent style disappeared.
Doesn't you??
Yes, that's why you also need to add your own style using 'wp_enqueue_style' as pointed in my previous reply.
Right now the child theme style loads in the footer, so after the parent theme is applied, it loads all page's content and then apply the child theme style.
So if you add it early in the queue (preferably right after parent style) this glitch shouldn't happen.
Thank you kindly direction. :)
I understand how it works.
Can you show me some example code ?
It will be very grateful for me.
// REMOVE STYLE
function cdctps_remove_child_theme_style() {
wp_dequeue_style( 'wplms_child_theme_style' );
}
add_action( 'wp_head', 'cdctps_remove_child_theme_style', 20 );
// ADD YOUR STYLE
function cdctps_add_child_theme_style() {
wp_enqueue_style( 'your-custom-css', get_stylesheet_directory_uri().'/style.css',array('wplms-style'));
}
add_action( 'wp_enqueue_scripts', 'cdctps_add_child_theme_style', 20 );
Thanks for sharing the information here.
Thank you so much urdek. :D