Hi there,
Im trying to enqueue elements stylesheets based on bricks function to enqueue elements assets:
public function enqueue_scripts() {
wp_enqueue_style( ‘exampleaux’, plugin_dir_url( FILE ) . ‘/examplescss/exampleaux.css’, array(), ‘1.0.1’, ‘all’, false);
wp_enqueue_script( ‘exampleaux’, plugin_dir_url( FILE ) . ‘/examplesjs/exampleaux.js’, array(‘bricks-scripts’), ‘1.0.1’, true);
}
The stylesheets are always loading at the end of the body and I need them at the head. It seems this function always enqueue styles and scripts at the end of the body no matter what.
I dont want to enqueue assets outside of the elements logic as I only want its styles and scripts to be loaded only if the element was called to be in the page.
Looking for a way to enqueue the elements stylesheets at the head only if the element exists on the page. Also would be a nice approach to be able to enqueue asyncrhonous scripts at the head.
Thanks in advance.