The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Problems getting Foundation 4 JS to work in WP

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #43097
    Jeremy Englert

    I’m merging [Foundation 4]( “”) with [Bones]( “”) to create a WP Starter theme. I had everything working fine with the JS from Foundation 3, but now that I’m trying to implement the Foundation 4 JS I’m running into some issues.

    I followed the steps found in the [Foundation 4 JS Documentation]( “”), but still had no luck. Here is the code I placed directly before the closing body tag (I know the correct way is to enqueue the script, but for testing I was just pasting it directly above the closing body tag):

    + ('__proto__' in {} ? 'zepto' : 'jquery')
    + '.js>');

    I’m attempting to open a modal on [this page,]( “”) but as you can see, the modal never fires when you click the link. I notice some errors in the Javascript console, but I’m still new to JS so they are a bit over my head.

    As I mentioned before, things were working fine with the Foundation 3 JS, which didn’t require the call to initialize the function – it just seemed to work. Not sure if that makes a huge difference, but it’s something I noticed that was different about the documentation for Foundation 4 JS compared to Foundation 3 JS.

    Can anyone get me pointed in the right direction?


    Looks like you need to drop in some php to point to the correct directory. For example, putting:

    in front of /library/…


    I was having a similar problem creating a WordPress theme with Foundation 4 and the Top-Bar

    I solved it by forcing it to use jQuery not Zepto (to make sure all other plugins were ok).

    Then included all the js files one by one instead of the foundation.min.js

    And debugged each.

    There is an error “Cannot read property ‘fn’ undefined” somewhere in the foundation.min.js file that might be causing the issue.


    Just tried it Modal seems to be working fine now. Not sure if you changed anything. I am using Chrome atm.



    If you are upgrading now to foundation 5 ive got a great way of getting it to work no conflict. see tutorial here

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.