Skip to content

Instantly share code, notes, and snippets.

@srueegger
Created November 21, 2018 11:56
Show Gist options
  • Save srueegger/94ab4b2ef24d2be816030e6107113dc4 to your computer and use it in GitHub Desktop.
Save srueegger/94ab4b2ef24d2be816030e6107113dc4 to your computer and use it in GitHub Desktop.
function fahrapp_startup_scripts() {
wp_enqueue_style( 'fahrapp-app-google-font', 'https://fonts.googleapis.com/css?family=Nunito' );
wp_enqueue_script( 'fontawesome-pro', 'https://pro.fontawesome.com/releases/v5.5.0/js/all.js', null, null, true);
if (WP_DEBUG):
wp_enqueue_style( "fahrapp-app-style", DEV_CSS . '/theme.css', array('fahrapp-app-google-font'), '1.0' );
wp_register_script( "fahrapp-app-script", DEV_JS ."/theme.js", array('jquery'), '1.0', true );
else:
wp_enqueue_style( "fahrapp-app-style", DIST_CSS . '/theme.min.css', array('fahrapp-app-google-font'), '1.0' );
wp_register_script( "fahrapp-app-script", DIST_JS ."/theme.min.js", array('jquery'), '1.0', true );
endif;
wp_localize_script( 'fahrapp-app-script', 'ajax_var', array('url' => admin_url('admin-ajax.php')) );
wp_enqueue_script( 'fahrapp-app-script' );
if(is_post_type_archive('app_fahrschuler')):
gravity_form_enqueue_scripts(get_field('setform_driver_edit', 'option'), true);
endif;
}
add_action( "wp_enqueue_scripts", "fahrapp_startup_scripts" );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment