Home / Archive / masonry.js
Duplicate Snippet

Embed Snippet on Your Site

masonry.js

Register and Enqueue masonry.js library for grid layouts

Code Preview
php
<?php
// Add custom scripts
function add_custom_script_masonry_js() {
			
			wp_register_script( 'masonry', 'https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js', array(), '4', true );
			wp_enqueue_script( 'masonry' );
			
}
add_action( 'wp_enqueue_scripts', 'add_custom_script_masonry_js' );

Comments

Add a Comment