Adding custom scripts to child theme

Posted in: Newsmag
Post count: 2

Hi,

I would like to add a custom script from Isotope (url: http://isotope.metafizzy.co/). I tried to add this to functions.php as a shortcode but I’m getting a white screen. In which php file is it possible to add custom scripts for shortcodes? Or I can add this by a custom .js file? Preferably in the child theme, so I don’t need to add it after every update.

Thanks in advance.

Post count: 9544

I think you would have a few issues with this, based on my own past experience. We use isotope on our business site (not using WP for main static content).

1) obviously you would need to upload the .js file to the theme folder, or your server
2) you would need to call the .js file for it to actually load the script
3) then you would have to place the elements into the theme file(s) where you would use the library.
4) this kind of thing doesn’t always work well with child themes, from my own experience due to the css redirects and such.

This plugin for WordPress might be helpful, perhaps not
http://mintthemes.com/isotope-for-wordpress/

Most people using isotope with WP are building their own themes and not patching it into a theme which already has a complex page builder, framework and shortcode system.

however, this old topic on adding it might prove useful
https://wordpress.org/support/topic/using-isotope-with-wordpress

  • This reply was modified 11 years by simchris.
Post count: 2

Thanks for your comments. Yesterday I got it fixed on my site with the Newsmag theme.

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