Product Dev Back to Ghost

How to update your theme to be forwards-compatible

How to Update Your Theme to be Forwards-Compatible

If you make and distribute themes for Ghost that depend on jQuery to function, you'll need to update them so that they become forwards compatible.

There is no harm in including jQuery twice (beyond the waste of resources), but it is possible to conditionally load jQuery if it doesn't exist already with a snippet like this:

<script type="text/javascript">  
  if (typeof jQuery == 'undefined') {
    document.write('<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"></'+'script>');
  }
</script>  

We highly recommend updating your themes to include jQuery themselves as soon as you can. Additionally, if you're a developer who has been dropping {{ghost_foot}} because of jQuery, please add it back! We'll soon be displaying warnings and errors for themes which fail to include the required helpers.