Tried in footer and still the same result Andrew!
very weird indeed! I got it working perfectly on my own site of phillipdews.com but thats not built on wordpress like this is but I cannot see that making any difference though.
Appreciate all the time your putting into this! I hope some other developers can get help from this thread.
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
No need to move it further.
Can you double-check what is being output by this:
`
<script src=”<?php echo get_template_directory_uri(); ?>/js/typed.js” type=”text/javascript”>
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Would it be possible to take everything from your view-source and put it into jsFiddle, removing the client-sensitive parts?
Wow well nothing really sensitive but I have pasted everything here fella as it’s midnight and hitting the sac fella. Here is the fiddle with everything…
https://jsfiddle.net/qeefuuu6/
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Okay I see an issue with the source code. There are 2 jQuery libraries being loaded. Only 1 must be loaded. I recommend you continue to use the jQuery version provided by WordPress and not try to load a different version.
Your theme is probably enqueing WordPress’ jQuery library, so you need to properly enqueue the typed.js script file. The typed.js script file must be enqueued so that it is loaded after the jQuery library.
Once that order has been achieved, the script that fires the typed.js code must be using “jquery noconflict” mode. This means that the dollar variable by default is undefined. This noconflict mode happens from the version of jQuery that WordPress uses.
So you need to change that script to this:
<script type="text/javascript">
jQuery(function($){
$("#typing").typed({
stringsElements:("#typed-strings"),
typeSpeed:30,
backDelay:500,
loop:true,
showCursor:true,
});
});
</script>
Specifically changing this:
$(function(){
To this:
jQuery(function($){
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Morning Andrew,
Thats great fella many thanks! One last thing though I have made the changes in the theme but the typed-strings are not typing and just the default ones. Here I have updated the latest fiddle..
https://jsfiddle.net/qeefuuu6/1/
Thanks again fella.
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Remember the ‘stringsElement’ option takes a jQuery object:
stringsElements:("#typed-strings"),
Should be:
stringsElements: $("#typed-strings"),
Andrew Nevins
(@anevins)
WCLDN 2018 Contributor | Volunteer support
Also, it’s not “stringsElements”. It’s “stringsElement”.