Adding Scripts or Styles

Only on Boilerplate Panel

  • upb_boilerplate_enqueue_scripts - Action hook to register or enqueue scripts or styles only on boilerplate.
add_action( 'upb_boilerplate_enqueue_scripts', function () {

    wp_register_style( 'custom_boilerplate_css', get_template_directory_uri() . '/custom-boilerplate-css.css', FALSE, '1.0.0' );

    wp_enqueue_style( 'custom_boilerplate_css' );
} );

Only on Preview Panel

  • upb_preview_enqueue_scripts - Action hook to register or enqueue scripts or styles only on preview panel.
add_action( 'upb_preview_enqueue_scripts', function () {

    wp_register_style( 'custom_preview_css', get_template_directory_uri() . '/custom-boilerplate-css.css', FALSE, '1.0.0' );

    wp_enqueue_style( 'custom_preview_css' );
} );

If you register scripts or styles using wp_enqueue_scripts it will automatically load on preview panel.

results matching ""

    No results matching ""