-1

I need to put my script in my function.php on my Wordpress but I don't found how to do it. Need help!

here's..:

<script type="text/javascript"> 

       $(function() {

           $( '#ri-grid' ).gridrotator( {
               rows        : 3,
               columns     : 5,
               animType    : 'fadeInOut',
               animSpeed   : 500,
               interval    : 1200,
               step        : 1,
               w320        : {
                   rows    : 3,
                   columns : 5
               },
               w240        : {
                   rows    : 3,
                   columns : 5
               }
           } );

       });
   </script>

Thx.

3
  • 1
    It's dangerous to go alone! Take this. codex.wordpress.org/Using_Javascript Commented Jun 2, 2017 at 15:51
  • This link can help you stackoverflow.com/questions/5882341/… Commented Jun 2, 2017 at 15:51
  • sounds like you need to use a template file rather than functions.php, look in your themes folder for the header.php or footer.php file and add the script there Commented Jun 2, 2017 at 15:57

1 Answer 1

0

Wordpress isn't that straightforward. For it to be so modular and user-friendly with plug-n-play, it has a complex structure.

There are different ways of adding scripts and it all depends on when they need to be available and/or executed.

Sign up to request clarification or add additional context in comments.

1 Comment

This script need to be executed at the opening of my page. it's lead a custom bloc on my home page. i just don't know how to transform that script to put it in my function.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.