WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] totally lost on jQuery things. (3 posts)

  1. mikeyyeah
    Member
    Posted 2 years ago #

    i was given a half built website to complete and whilst i have a degree in multimedia design i have no experience in jQuery or WordPress. i have absolutley no idea how to check if this jquery is even firing off.. the scripts were already in the previous halfassed/half built template.. i have looked all day online and im sure im just missing something simple, but id really appreciate if someone could have a gader at this and tell me what maybe going on...

    in my functions.php file i have

    if (!is_admin()) {
            wp_deregister_script('jquery'); //Stop WordPress default jQuery
            wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js', false, '1.3.2'); //Load Googles jQuery
            wp_enqueue_script('jquery');
    
            //Load jquery plugin
            wp_register_script('corner','http://stasheverything.com/www/stash/wp-content/themes/Stashv2_0/js/jquery.corner.js', 'jquery', '1.0'); //'jquery' is passed as a reference so that this loads AFTER 'jquery'
            wp_enqueue_script('corner');
            wp_register_script('pixastic','http://stasheverything.com/www/stash/wp-content/themes/Stashv2_0/js/pixastic.custom.js', 'jquery', '1.0'); //'jquery' is passed as a reference so that this loads AFTER 'jquery'
            wp_enqueue_script('pixastic');
            wp_register_script('masonry','http://stasheverything.com/www/stash/wp-content/themes/Stashv2_0/js/jquery.masonry.min.js', 'jquery', '1.0'); //'jquery' is passed as a reference so that this loads AFTER 'jquery'
            wp_enqueue_script('masonry');
            wp_register_script('jcarousel','http://stasheverything.com/www/stash/wp-content/themes/Stashv2_0/js/jquery.jcarousel.min.js', 'jquery', '1.0'); //'jquery' is passed as a reference so that this loads AFTER 'jquery'
            wp_enqueue_script('jcarousel');
            wp_register_script('imgr','http://stasheverything.com/www/stash/wp-content/themes/Stashv2_0/js/jquery.imgr.min.js', 'jquery', '1.0'); //'jquery' is passed as a reference so that this loads AFTER 'jquery'
            wp_enqueue_script('imgr');
    
            //Load custom script
           wp_register_script('custom','http://stasheverything.com/www/stash/wp-content/themes/Stashv2_0/js//scripts.js', 'imgr', '1.0'); //'jquery_validator' is passed as a reference so that this loads AFTER the plugin
           wp_enqueue_script('custom');
    }

    and in my header i have

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <title><?php if (is_home () ) { bloginfo('name'); } elseif ( is_category() ) { single_cat_title(); echo ' - ' ; bloginfo('name'); }
     elseif (is_single() ) { single_post_title(); }
     elseif (is_page() ) { bloginfo('name'); echo ': '; single_post_title(); }
     else { wp_title('',true); } ?></title>
    <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/script.js"></script>
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <!--[if IE 6]><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie6.css" type="text/css" media="screen" /><![endif]-->
    <!--[if IE 7]><link rel="stylesheet" href="<?php bloginfo('template_url'); ?>/style.ie7.css" type="text/css" media="screen" /><![endif]-->
    <link rel="alternate" type="application/rss+xml" title="<?php printf(__('%s RSS Feed', 'kubrick'), get_bloginfo('name')); ?>" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="application/atom+xml" title="<?php printf(__('%s Atom Feed', 'kubrick'), get_bloginfo('name')); ?>" href="<?php bloginfo('atom_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <?php wp_head(); ?>

    at the very top.
    these are all post decorative effects. is there somewhere else i should be calling them? and how can i tell if jquery is even working, like just a test popup? i cant seem to even get that work.... probably a total facepalm stupid simple thing on my behalf like not actually then calling the scripts but yeahhhh. any help gladlu appreciated

  2. Paul
    Member
    Posted 2 years ago #

    Try to put the

    if (!is_admin()) {
    ...
    }

    in an action hook like...

    function myscripts() {
       if (!is_admin()) {
       ...
       }
    }
    add_action('init', 'myscripts');
  3. mikeyyeah
    Member
    Posted 2 years ago #

    ok i'll give that whirl. cheers

Topic Closed

This topic has been closed to new replies.

About this Topic