Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Forum: Fixing WordPress
    In reply to: Managing js files
    Thread Starter gkhabas

    (@gkhabas)

    Thank you Pioneer Web Design for the solution.

    Forum: Fixing WordPress
    In reply to: Managing js files
    Thread Starter gkhabas

    (@gkhabas)

    Hello Andrew,
    I have got almost 20 js files. When I used all 20 files my pages doesn’t load and displays the message “Database Connection Failed”. When I remove half js files then the pages load.

    Forum: Fixing WordPress
    In reply to: Managing js files
    Thread Starter gkhabas

    (@gkhabas)

    I am sure about the issue Andrew..
    Can u give me some solutions for the problem?

    Thread Starter gkhabas

    (@gkhabas)

    Thank you stephencottontail for your help..

    Thread Starter gkhabas

    (@gkhabas)

    Hello stephencottontail,
    My site is not live. I am currently running this site on local server xampp..
    If you can provide me your email address or skype id then I can discuss my problem with you and I can also send my error files so you can help me…

    Thanks… 🙂

    Thread Starter gkhabas

    (@gkhabas)

    Guys, I am still confuse
    My function.php code
    function theme_js()
    {
    wp_enqueue_script(‘min_js’, get_template_directory_uri() . ‘/js/jquery.min.js’, array(‘jquery’), ”, true);
    wp_enqueue_script(‘cycle_js’, get_template_directory_uri() . ‘/js/slider/jquery.cycle.all.js’, array(‘jquery’), ”, true);
    wp_enqueue_script(‘chilli_js’, get_template_directory_uri() . ‘/js/slider/chili-1.7.pack.js’, array(‘jquery’), ”, true);
    }
    add_action(‘wp_enqueue_scripts’, ‘theme_js’);

    My original header.php code
    <script type=”text/javascript” src=”js/jquery.min.js”></script>
    <script type=”text/javascript” src=”js/slider/jquery.cycle.all.js”></script>
    <script type=”text/javascript” src=”js/slider/chili-1.7.pack.js”></script>

    <script type=”text/javascript”>
    $(function() {
    $(‘#slideshow’).cycle({ slideExpr: ‘img’ });

    $(‘#zoom’).cycle({
    fx: ‘zoom’,
    sync: false,
    delay: -2000
    });

    $(‘#slide’).cycle({
    fx: ‘turnDown’,
    delay: -4000
    });

    $(‘#up’).cycle({
    fx: ‘curtainX’,
    sync: false,
    delay: -2000
    });

    });
    </script>
    When i delete the above code in header.php the js won’t work.

    So i modified the code in header.php and deleted the function.php code
    Modified header.php code
    <script type=”text/javascript” src=”<?php echo get_stylesheet_directory_uri() . ‘/js/jquery.min.js’ ?>”></script>
    <script type=”text/javascript” src=”<?php echo get_stylesheet_directory_uri() . ‘/js/slider/jquery.cycle.all.js’ ?>”></script>
    <script type=”text/javascript” src=”<?php echo get_stylesheet_directory_uri() .’/js/slider/chili-1.7.pack.js’ ?>”></script>

    <script type=”text/javascript”>
    $(function() {
    $(‘#slideshow’).cycle({ slideExpr: ‘img’ });

    $(‘#zoom’).cycle({
    fx: ‘zoom’,
    sync: false,
    delay: -2000
    });

    $(‘#slide’).cycle({
    fx: ‘turnDown’,
    delay: -4000
    });

    $(‘#up’).cycle({
    fx: ‘curtainX’,
    sync: false,
    delay: -2000
    });

    });
    </script>

    <?php wp_head(); ?>
    </head>
    This works fine. But i want to only code in function.php and remove the js link in header.php

    Can u guys can help me??

    and one more thing…
    <script type=”text/javascript”>
    $(function() {
    $(‘#slideshow’).cycle({ slideExpr: ‘img’ });

    $(‘#zoom’).cycle({
    fx: ‘zoom’,
    sync: false,
    delay: -2000
    });

    $(‘#slide’).cycle({
    fx: ‘turnDown’,
    delay: -4000
    });

    $(‘#up’).cycle({
    fx: ‘curtainX’,
    sync: false,
    delay: -2000
    });

    });
    </script>

    The above code is used for sliding the image… what should be done to this code.. Currently I am using this code in header.php

    Thread Starter gkhabas

    (@gkhabas)

    Hello Mr.Ravi
    I do have one more question…
    while linking js file,do we have to add js code and link to the header.php file also??

    Thread Starter gkhabas

    (@gkhabas)

    Thank you stephencottontail… It works… 🙂

Viewing 8 replies - 1 through 8 (of 8 total)