Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #238647

    Hello,
    I’ve just found out that, after having implemented jquery in my website, the previews images of the single posts don’t appear anymore.

    I created a new template in the template builder area, added the element “Blog” with one only category to pick the posts from and set “show pagination”.
    Then I created a page and chose the mentioned template.

    Few days ago everything was working properly but now that I’ve added the following code to the header of my website, all the featured images are not shown anymore.

    “<script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js”></script>”

    I know the issue is related with the code that loads jquery because if I remove this script everything works well, but I really need to use some jquery scripts on my website.

    What can I do in order to use jquery code in my website AND, of course, mantain the default features of the template itself?
    If you want to have a look this is a page where the cited problem appears clearly:

    http://www.wildlifechronicles.com/journal/

    thank you very much
    Matteo

    #239753

    Hi matteora!

    The theme already comes with jquery loaded in and adding it in that would is definitely going to cause issues with WordPress in general.

    You need to enque scripts instead: http://codex.wordpress.org/Function_Reference/wp_enqueue_script

    Even still it shouldn’t be included like that since WordPress has its own version of jquery loaded in.

    Cheers!
    Devin

    #239994

    Devin thanks for the reply.
    For me shouldn’t be a big deal using the WordPress version of jquery, I just need to use jquery regardless of where it comes from.
    Unfortunately from the link you posted I don’t understand how to enque my script… do you mind having a look at my website (same page: http://www.wildlifechronicles.com/journal/) and suggesting me how to enque those script?

    <script type="text/javascript">
    $(function(){
    	$("#contributors_explorers div a").hover(function(){
    		$("img", this).stop().animate({left:"-354px"},{queue:false,duration:450});
    	}, function() {
    		$("img", this).stop().animate({left:"0px"},{queue:false,duration:175});
    	});
    });</script>
    <script type="text/javascript">
    $(function(){
    	$("#professional_workshop div a").hover(function(){
    		$("img", this).stop().animate({right:"-234px"},{queue:false,duration:450});
    	}, function() {
    		$("img", this).stop().animate({right:"0px"},{queue:false,duration:175});
    	});
    });</script>

    Thank you again
    Matteo

    #240464

    If the codex entry is a bit much for you then I would suggest using a plugin instead. Something like: http://wordpress.org/plugins/css-javascript-toolbox/

    I’ve not used that specific one but it looked good and was one of the first that came up when searching for something like this.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.