jQuery management in Classipress
Hello,
I know that there were several threads on the subject but I do not find a basic solution to make sure that the jQuery is properly installed in Classipress.
I have mostly identify 2 recommendations (child them recommanded) :
1/ Add a function in functions.php
// jQuery
add_action('init', 'prefix_init');
function prefix_init(){
if(is_admin()){
wp_enqueue_script('jquery');
}
}
2/ Modify the head section of wrapper.php
Here is the extract with the addedcode in red:
<?php if ( is_singular() && get_option('thread_comments') ) wp_enqueue_script('comment-reply'); ?>
<?php wp_enqueue_script("jquery"); ?>
<?php wp_head(); ?>
<script type="text/javascript"
src="<?php bloginfo("template_url"); ?>/js/yourScript.js"></script>
As I am not a specialist in php I didn't identify what is the difference between the two methods and I don't know what are the incidence of them on the website functionality.
Moreover I saw that in Classipress the jQuery files are numerous and in
wp-includes/
js/jquey folder and not in a
wp-content/theme/classipress/
js folder as it seems to be usually.
Your comments are welcome.