Adding Bootstrap to WordPress theme

By default, the WordPress bundled jQuery is loaded in no-conflict mode which doesn’t populate $. This caused $ is not defined and $ is not a function errors in Bootstrap and MDBootstrap, which I use in the SeabadgerMD WordPress theme.

As per the WordPress theme requirements, you are not supposed to use your own jQuery. Therefore I took a look at the mdb.js and bootstrap.js files and it was quite straight forward to fix this issue.



Tagged with
Comment

PageSpeed Insights: An error occurred while fetching or analyzing the page

I’ve seen this happening before for large websites, apparently the Google PageSpeed Insights rendering times out for some large websites with many assets (>200). But talented I am, I’ve managed to break it with my tiny 600kB blog with 17 resources. After reaching around 60% on load/analyze, I got the the not-so-helpful message:

An error occurred while fetching or analyzing the page

Eventually found the solution, which was rather unexpected.



Tagged with
Comment

Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input’

When running ng test I got "Can't bind to 'ngModel' since it isn't a known property of 'input'", even though if I run the code with ng serve, there is no issue. This post is a hint to include core module dependencies, when setting up the TestBed in Angular 2.



Tagged with
Comment