19 Oct 2019

Stoping styles.css being called into the site twice

This is happening because the parent theme is calling in styles.css using enque.

Disable it by adding the following into the child themes functions file:


/* -- Removes the parent theme stylesheet,
to stop it being called twioce (Foundation CSS was being called after style.css)
-- */
function PREFIX_remove_scripts() {
wp_dequeue_style( 'screen' );
wp_deregister_style( 'screen' );

wp_dequeue_script( 'site' );
wp_deregister_script( 'site' );

// Now register your styles and scripts here
}
add_action( 'wp_enqueue_scripts', 'PREFIX_remove_scripts', 20 );
/* -- Removes the parent theme stylesheet END -- */