We help IT Professionals succeed at work.
Get Started

Anything Slider not working on Wordpress site

Alicia St Rose
on
1,127 Views
Last Modified: 2012-05-11
Hi,
I've been trying to debug this for hours.
I've got an anything slider on the homepage of my Wordpress site. I've used this slider before on other Wordpress sites and it's worked fine.
I'm building the site using a child theme of The Hybrid Framework. I loaded the javascripts by way of hooks and filters in the functions.php.

I checked my code over and over again. It looks accurate but I'm getting no results. I've changed the $ to jQuery in order to avoid javascript conflicts. I have another jQuery script for my twitter updates in the footer and that's working fine. Just no dice with the slider.

can anyone see what I'm missing?

http://sandbox.intrepidrealist.com/my-site/
http://sandbox.intrepidrealist.com/my-site/wp-content/themes/intrepidrealist/js/jquery.easing.1.2.js?ver=3.1
http://sandbox.intrepidrealist.com/my-site/wp-content/themes/intrepidrealist/js/jquery.anythingslider.js?ver=3.1

Below you will find the code I added to my functions.php file.

Thanks!
// add jQuery to head of document
add_action('template_redirect', 'my_init_method');

function my_init_method() {

	if (!is_admin()){
		
		wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js');
    wp_enqueue_script( 'jquery' );
		wp_enqueue_script('jquery.easing.1.2', get_stylesheet_directory_uri() . '/js/jquery.easing.1.2.js');
		wp_enqueue_script('jquery.anythingslider', get_stylesheet_directory_uri() . '/js/jquery.anythingslider.js');
		wp_enqueue_script('jquery.tweet', get_stylesheet_directory_uri() . '/js/jquery.tweet.js');
	
	}

}    

//add twitter script and anything slider script to head
function my_in_head(){ 	?>

	<script type="text/javascript">
		function formatText(index, panel) {
		  return index + "";
	    }
    
        jQuery(function () {
        
        jQuery('.anythingSlider').anythingSlider({
            easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
            autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
            delay: 6000,                    // How long between slide transitions in AutoPlay mode
            startStopped: false,            // If autoPlay is on, this can force it to start stopped
            animationTime: 1000,             // How long the slide transition takes
            hashTags: true,                 // Should links change the hashtag in the URL?
            buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
        		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
        		startText: "",             // Start text
		        stopText: " ",               // Stop text
		        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
            });
            
            jQuery("#slide-jump").click(function(){
                jQuery('.anythingSlider').anythingSlider(6);
            });
            
        });

	}); //end document ready functions

	/* ]]> */
	</script>
	<script type="text/javascript">
	//<![CDATA[

	
    jQuery(document).ready(function(){
        jQuery(".tweet").tweet({
            username: "IntrepidRealist",
            join_text: "auto",
            avatar_size: 36,
            count: 1,
            auto_join_text_default: " ",
            auto_join_text_ed: "I",
            auto_join_text_ing: "I was",
            auto_join_text_reply: "I replied to",
            auto_join_text_url: "I was checking out",
            loading_text: "loading tweets..."
        });
    });
		</script>
		

<?php }

add_action('wp_head', 'my_in_head');

Open in new window

Comment
Watch Question
Consultant & Challenge Subduer
CERTIFIED EXPERT
Top Expert 2009
Commented:
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE