[Bug report] JS error $(...).flexslider is not a function

Hi guys,

The theme is very nice. I tried to use it on my page but received a JS error as a result of which the other (3rd party) jQuery plug-ins does not initialise.

It is easy to reproduce the issue on the official shapely demo page:

Open: https://colorlib.com/shapely/
Open the developer console
So far so good :slight_smile:
Look at the menu and navigate to ‘About the tests > Page Image Alignment’

At this point you should notice a JavaScript error “flexible-scripts.js?ver=20160115:139 Uncaught TypeError: $(…).flexslider is not a function”

The error does not occur on the front page.

I believe the issue occurs because the flexslider is loaded only for the front page, I recall seeing this in the theme source.

Would you be able to fix it or let me know how to patch it.

@sasheto

This is just a TypeError and it can’t in any way affect how theme works with other jQuery plugins. There must be something else with your code or plugin incompatibility but this error is not one to blame. We will fix that in the future updates but you need to look elsewhere why your jQuery plugins aren’t working.

@Aigars

Thanks for the answer.

I will investigate further then. The problem is within the NextGen gallery plug-in. It seems to not get initialised and there are no errors except this one.

Do I have to disable some Shapely feature? Probably you can give me a hint.

Love this theme. So far everything is working as hoped and expected except that I am also seeing the same JavaScript error reported above (same one displayed in the Shapely demo site is also seen in my installation of Shapely).

It causes the lightbox effect to fail in the Nextgen gallery plugin (jquery stops after js error). I temporarily commented out the flexslider code in the shapely-scripts.js file an the error message stopped and the lightbox effect resumed in the Nextgen plugin.

Thanks!

@rick60 This can be due to plugin conflict on your site so please try temporary deactivating all plugins and see whether everything works fine and then enable the plugins one by one to see which plugin is conflicting if any.

Alternatively you can try using the solution posted in the following reply.

https://colorlibsupport.com/t/wp-tiles-and-shapely-issue/#post-51075

I just confirmed that this is also happening on my WP installation that uses Shapely.

It’s also happening on the Shapely demo site. It seems to only happen when viewing a single post. You can see the error live on the demo site by viewing this “hello world” post.

To narrow things down, I am using Google Chrome in incognito mode with no Chrome extensions enabled.

It would be great if this could be fixed for all of us!

Thanks,
Justin

Update: The functions.php content that @Movin provides in the WP Tiles and Shapely Issue thread seems to have fixed the js issue.

Can this fix can be incorporated into the official theme?

Thanks,
Justin

Hi Justin,

Yes we are fixing it in the upcoming version of theme.

Cheers,
Movin