I'm about an four hours browsing an internet in order to find an answer.
I have an javascript/php/html application with rich functionality. It includes 3 css files and 5 javascript files.
I want to build it in wordpress page.
I have already made custom page template: checkout.php
Now i need to replace all the stylesheets and javascripts with my own.
I know how to check the template:
<?php if(is_page_template('checkout.php')) :?>
<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri(); ?>/stylesheets/main.css"/>
<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri(); ?>/stylesheets/jquery.Jcrop.css" />
<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri(); ?>/stylesheets/styles.css" />
<script src="<?php echo get_template_directory_uri(); ?>/javascripts/js_checkout/jquery.min.js"></script>
<script src="<?php echo get_template_directory_uri(); ?>/javascripts/js_checkout/jquery-ui.js"></script>
<script src="<?php echo get_template_directory_uri(); ?>/javascripts/js_checkout/jquery.Jcrop.js"></script>
<script src="<?php echo get_template_directory_uri(); ?>/javascripts/js_checkout/script.js"></script>
I also guess that this functions will add all stylesheets and javascripts to my new template:
function theme_name_scripts() {
wp_enqueue_style( 'style-name', get_stylesheet_uri() );
wp_enqueue_script( 'script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'theme_name_scripts' );
But do wp_enqueue_style and wp_enqueue_script replaces the default styles and scripts or just add another????
Can some one just tell me how to do this and what file to edit?? header.php or general-template.php??
Thanks in advance alot