Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Masonry with Infine scroll page template
<?php
/*
Template Name: Masonry Grid Scroll
*/
/*
* @author Frank Schrijvers
* @link https://www.wpstud.io
*/
// Enqueue scripts for masonry and infinite scroll
add_action('wp_enqueue_scripts', 'wpstudio_load_scripts_frontpage');
function wpstudio_load_scripts_frontpage() {
wp_enqueue_script( 'infinite_scroll', get_stylesheet_directory_uri() . '/js/jquery.infinitescroll.min.js', array( ),null,true );
wp_enqueue_script( 'mansonry-isotope', get_stylesheet_directory_uri() . '/js/masonry-isotope.min.js', array('infinite_scroll'),null, true );
wp_enqueue_script( 'mansonry-init', get_stylesheet_directory_uri() . '/js/init-masonry.min.js', array('jquery'),null, true );
wp_enqueue_script( 'jquery-masonry', array( 'jquery' ), true );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.