Masonry images not working
Masonry images not working
Masonry images not working
Masonry, WP_Query & paged – first page repeating, second page not loading
I have now solved point (2), the overlapping posts problem; maybe this will help someone else. I changed wrapper to true in the mytheme_jetpack_setup function in my PHP (so that the new posts are wrapped in their own div) And I changed the jQuery to: $(‘#content’).masonry({ columnWidth: ‘.grid-sizer’, itemSelector: ‘article’, gutter: ‘.gutter-sizer’ }); var infiniteCount … Read more
The Isotope documentation about ImagesLoaded suggest two methods for this. I generally use the second one, which means: initializing Isotope and trigger layout after the images have been loaded. In my experience this works better, not that I have facts to proof it. Aside from that, I have it running this way successfully on a … Read more
Okay, so I made Underscore and Masonry a Dependency of another script and then it worked. I stopped trying to enqueue add action core scripts and just set it as a dependency for the script that needed it. Now, I’m not entirely sure if that is how it’s supposed to work, I thought you still … Read more
Followed the same article and ran into the same issue; the author (Josh Pollock) posted a followup on his blog. Essentially from WP 3.9, Masonry is there for you to use so all you need in functions.php is: add_action( ‘wp_enqueue_scripts’, ‘slug_masonry’ ); function slug_masonry( ) { wp_enqueue_script(‘masonry’); // note this is not jQuery } and … Read more
This error means that the resource (JS file in this case) that you’re loading is expected to be JS and is instead HTML. It could be because your path is incorrect or because the local file is not JS. More than likely, your provided script at /assets/js/masonry-script.js is not a JS file or couldn’t be … Read more
You can’t actually “remove” PHP code from the parent theme. What you can do is undo things done there. The counterpart of wp_enqueue_script is wp_dequeue_script. If you put this in your functions.php it should remove the Masonry Plugin (untested) add_action( ‘wp_print_scripts’, ‘de_script’, 100 ); function de_script() { wp_dequeue_script( ‘jquery-masonry’ ); } Source: Function Reference/wp dequeue … Read more