Title: TypeError issue
Last modified: March 1, 2017

---

# TypeError issue

 *  [Phillip Dews](https://wordpress.org/support/users/phillipdewsblogger/)
 * (@phillipdewsblogger)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/)
 * Hi all,
 * I am building a custom theme for a new client and im trying to implement the 
   awesome typed.js within the code of my theme. so this is what i have got in my
   code so far..
 * In my header.php I am calling this…
    `<script src="https://ajax.googleapis.com/
   ajax/libs/jquery/2.2.4/jquery.min.js"></script>`
 * In my front-page.php where I want the typed.js to work I have this….
 *     ```
       <script src="<?php echo get_template_directory_uri(); ?>/js/typed.js" type="text/javascript"></script>
           <script type="text/javascript">
             $(function(){
               $("#typing").typed({
                 stringsElements:("#typed-strings"),
                 typeSpeed:30,
                 backDelay:500,
                 loop:true,
                 showCursor:true,
               });
             });
           </script>
           <section id="typed-wrapper"><h1 class="welcome">Welcome to Monkeypants we: <span id="typing style=white-space:pre"></span></h1></section>
           <section id="typed-strings">
             <h2>Phrase or Sentence 1</h2>
             <h2>Phrase or Sentence 2</h2>
             <h2>Phrase or Sentence 3</h2>
             <h2>Phrase or Sentence 4</h2>
             <h2>Phrase or Sentence 5</h2>
           </section>
         </section>
       ```
   
 * You can see my issues here with this screengrab.
    ⌊TypeError Issue⌉
 * Im assuming it’s a jQuery conflict but I know that I am only calling the 1 jquery
   cdn link as this is a custom built theme that I am developing from the groundup.
 * Many thanks for any help.
    Phillip Dews

Viewing 15 replies - 1 through 15 (of 25 total)

1 [2](https://wordpress.org/support/topic/typeerror-issue/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/typeerror-issue/page/2/?output_format=md)

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/#post-8863300)
 * You’ll have to show us a page with the issue
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/#post-8863308)
 * Actually I didn’t see the screenshot of the error.
 * Can you create a PasteBin file with the contents of your ‘typed.js’ file? Then
   link us that.
    -  This reply was modified 9 years, 3 months ago by [Andrew Nevins](https://wordpress.org/support/users/anevins/).
 *  Thread Starter [Phillip Dews](https://wordpress.org/support/users/phillipdewsblogger/)
 * (@phillipdewsblogger)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/#post-8863350)
 * Hi Andrew,
 * thank you for the quick reply. I have never used pastebin or any other service
   like that before. I have (I think correctly) created a fiddle here: [https://jsfiddle.net/jyxa51vy/](https://jsfiddle.net/jyxa51vy/)
 * Many thanks.
    Phillip
 *  Thread Starter [Phillip Dews](https://wordpress.org/support/users/phillipdewsblogger/)
 * (@phillipdewsblogger)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/#post-8863355)
 * opps sorry her is another link [https://jsfiddle.net/jyxa51vy/3/](https://jsfiddle.net/jyxa51vy/3/)
    -  This reply was modified 9 years, 3 months ago by [Phillip Dews](https://wordpress.org/support/users/phillipdewsblogger/).
 *  Thread Starter [Phillip Dews](https://wordpress.org/support/users/phillipdewsblogger/)
 * (@phillipdewsblogger)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/#post-8863404)
 * Just made another fiddle and added typed.js as an external resource fella. Here
   is the link..
    [https://jsfiddle.net/jyxa51vy/6/](https://jsfiddle.net/jyxa51vy/6/)
 * Thanks again
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/#post-8863440)
 * The HTML is slightly off in the jsFiddle example:
 *     ```
       <span id="typing style=white-space:pre"></span></h1></section>
       ```
   
 * Try this instead:
 *     ```
       <span id="typing" style="white-space:pre"></span></h1></section>
       ```
   
 *  Thread Starter [Phillip Dews](https://wordpress.org/support/users/phillipdewsblogger/)
 * (@phillipdewsblogger)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/#post-8863447)
 * Hmm that’s working after a fashion as you can see here [https://jsfiddle.net/jyxa51vy/10/](https://jsfiddle.net/jyxa51vy/10/)
   but the typed-strings are not showing though weirdly when it should be those 
   that are being typed out
 * Have put your fix in the actual theme as well but nothing is typing there weirdly
   and I am still getting the….
    `TypeError: $(...).typed is not a function` in 
   the console
 * Many thanks
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/#post-8863453)
 * I noticed that you’re mispelling the ‘stringsElement’ option slightly. It doesn’t
   have an ‘s’ on the end. That then generates an error in the console for that 
   jsFiddle but at least we’re progressing.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/#post-8863455)
 * > Have put your fix in the actual theme as well but nothing is typing there weirdly
   > and I am still getting the….
   >  TypeError: $(…).typed is not a function in the
   > console
 * That would suggest the typed.js file isn’t loading properly.
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/#post-8863463)
 * Try this: [https://jsfiddle.net/jyxa51vy/15/](https://jsfiddle.net/jyxa51vy/15/)
 * Do you see the difference?
    According to the docs, the strings must each be wrapped
   in a paragraph and the option must take a jQuery object: [https://github.com/mattboldt/typed.js/blob/master/README.md](https://github.com/mattboldt/typed.js/blob/master/README.md)
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/#post-8863467)
 * In your WordPress template, put this script right at the bottom of the template:
 *     ```
       <script type="text/javascript">
             $(function(){
               $("#typing").typed({
                 stringsElements:$("#typed-strings"),
                 typeSpeed:30,
                 backDelay:500,
                 loop:true,
                 showCursor:true,
               });
             });
           </script>
       ```
   
 * Note it has to be before the </body> tag
    -  This reply was modified 9 years, 3 months ago by [Andrew Nevins](https://wordpress.org/support/users/anevins/).
 *  Thread Starter [Phillip Dews](https://wordpress.org/support/users/phillipdewsblogger/)
 * (@phillipdewsblogger)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/#post-8863472)
 * We certainly are Andrew, many thanks. I’m surprised that it’s not loading properly
   as I ma calling it correctly. here is the link to that direct file…
 * [https://www.monkeypantsproductions.co.uk/wp-content/themes/monkeypants/js/typed.js](https://www.monkeypantsproductions.co.uk/wp-content/themes/monkeypants/js/typed.js)
 * I have also updated the fiddle with the s removed as suggested but still the 
   same [https://jsfiddle.net/jyxa51vy/14/](https://jsfiddle.net/jyxa51vy/14/)
 * Appreciate all the help Andrew.
 *  Thread Starter [Phillip Dews](https://wordpress.org/support/users/phillipdewsblogger/)
 * (@phillipdewsblogger)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/#post-8863501)
 * OK have redone everything in your fiddle on the theme and wrapped them in <p>
   tags but still getting the error weirdly when it’s working perfectly fine in 
   the fiddle!
 * getting there though I see, turning into quite a challenge hey!
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/#post-8863516)
 * Did you manage to move the following script to the bottom of the template:
 *     ```
       <script type="text/javascript">
             $(function(){
               $("#typing").typed({
                 stringsElements:$("#typed-strings"),
                 typeSpeed:30,
                 backDelay:500,
                 loop:true,
                 showCursor:true,
               });
             });
           </script>
       ```
   
 *  Thread Starter [Phillip Dews](https://wordpress.org/support/users/phillipdewsblogger/)
 * (@phillipdewsblogger)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/#post-8863522)
 * Certainly did, I put it just above the <?php get_footer(); ?> in that template
   file!
    Want me to try it in the footer itself? I also moved the link to the typed.
   js file just above it to the file now looks like this…
 *     ```
         <section id="section2">
           <section id="typed-wrapper"><h1 class="welcome">Welcome to Monkeypants we: <span id="typing" style="white-space:pre"></span></h1></section>
           <section id="typed-strings">
             <p>Phrase or Sentence 1</p>
             <p>Phrase or Sentence 2</p>
             <p>Phrase or Sentence 3</p>
           </section>
         </section>
       </div>
       <script src="<?php echo get_template_directory_uri(); ?>/js/typed.js" type="text/javascript"></script>
       <script type="text/javascript">
         $(function(){
           $("#typing").typed({
             stringElement:$("#typed-strings"),
             typeSpeed:30,
             backDelay:500,
             loop:true,
             showCursor:true,
           });
         });      
       </script>
       ```
   
 * I will try it in the footer.php instead and see if that makes any difference!

Viewing 15 replies - 1 through 15 (of 25 total)

1 [2](https://wordpress.org/support/topic/typeerror-issue/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/typeerror-issue/page/2/?output_format=md)

The topic ‘TypeError issue’ is closed to new replies.

## Tags

 * [customtheme](https://wordpress.org/support/topic-tag/customtheme/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [typeerror](https://wordpress.org/support/topic-tag/typeerror/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 25 replies
 * 2 participants
 * Last reply from: [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/typeerror-issue/page/2/#post-8865035)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
