File "js-customizer.php"

Full Path: /home/flipjqml/onlinebetsolution.com/wp-content/themes/xion-progression/inc/js-customizer.php
File size: 4.45 KB
MIME-type: text/x-php
Charset: utf-8

<?php
/**
 * Progression JS Customizer
 *
 * @package pro
 */

function progression_studios_enqueue_script() {
	
	if ( is_tax( 'portfolio-category' ) ) {
   	
		if ( get_theme_mod( 'progression_studios_blog_pagination') == 'infinite-scroll' ) {
		   wp_add_inline_script( 'xion-progression-scripts', '	
				jQuery(document).ready(function($) { 
					"use strict";
		
					/* Default Isotope Load Code */
					var $container = $(".progression-studios-video-index-list").isotope();
					$container.imagesLoaded( function() {
						$(".progression-masonry-item").addClass("opacity-progression");
						$container.isotope({
							itemSelector: ".progression-masonry-item",				
							percentPosition: true,
							layoutMode: "' . esc_attr(get_theme_mod( "progression_studios_blog_masonry_fit", "fitRows")) . '" 
				 		});
					});
					/* END Default Isotope Code */
					
					
					/* Begin Infinite Scroll */
					$container.infinitescroll({
					  navSelector  : ".infinite-nav-pro",  
					  nextSelector : ".nav-previous a", 
					  itemSelector : ".progression-masonry-item", 
				   		loading: {
				   		 	img: "' . esc_url( get_template_directory_uri() ) . '/images/loader.gif",
				   			 msgText: "",
				   		 	finishedMsg: "<div id=' . "'" . 'no-more-posts' . "'" . '>' . esc_html__( "No more posts", "xion-progression" ) . '</div>",
				   		 	speed: 0, }
					  },
					  // trigger Isotope as a callback
					  function( newElements ) {

					    var $newElems = $( newElements );
		 	
							$newElems.imagesLoaded(function(){
							
							$container.isotope( "appended", $newElems );
							$(".progression-masonry-item").addClass("opacity-progression");
						
						});

					  }
					);
				    /* END Infinite Scroll */
					 
	 	 			

				});
			' 
			);
		}elseif ( get_theme_mod( 'progression_studios_blog_pagination', 'load-more') == 'load-more' ) {
		   wp_add_inline_script( 'xion-progression-scripts', '	
				jQuery(document).ready(function($) { 
					"use strict";
		
					/* Default Isotope Load Code */
					var $container = $(".progression-studios-video-index-list").isotope();
					$container.imagesLoaded( function() {
						$(".progression-masonry-item").addClass("opacity-progression");
						$container.isotope({
							itemSelector: ".progression-masonry-item",				
							percentPosition: true,
							layoutMode: "' . esc_attr(get_theme_mod( "progression_studios_blog_masonry_fit", "masonry")) . '" 
				 		});
					});
					/* END Default Isotope Code */
					
					
					/* Begin Infinite Scroll */
					$container.infinitescroll({
						errorCallback: function(){  $(".infinite-nav-pro").delay(500).fadeOut(500, function(){ $(this).remove(); }); },
					  navSelector  : ".infinite-nav-pro",  
					  nextSelector : ".nav-previous a", 
					  itemSelector : ".progression-masonry-item", 
				   		loading: {
				   		 	img: "' . esc_url( get_template_directory_uri() ) . '/images/loader.gif",
				   			 msgText: "",
				   		 	finishedMsg: "<div id=' . "'" . 'no-more-posts' . "'" . '>' . esc_html__( "No more posts", "xion-progression" ) . '</div>",
				   		 	speed: 0, }
					  },
					  // trigger Isotope as a callback
					  function( newElements ) {
												
					    var $newElems = $( newElements );
		 	
							$newElems.imagesLoaded(function(){
							
							$container.isotope( "appended", $newElems );
							$(".progression-masonry-item").addClass("opacity-progression");
						
						});

					  }
					);
				    /* END Infinite Scroll */
					 
	 	 			/* PAUSE FOR LOAD MORE */
	 	 			$(window).unbind(".infscr");
	 	 			// Resume Infinite Scroll
	 	 			$(".nav-previous a").click(function(){
	 	 				$container.infinitescroll("retrieve");
	 	 				return false;
	 	 			});
	 	 			/* End Infinite Scroll */

				});
			' 
			);
		} else {
			
		   wp_add_inline_script( 'xion-progression-scripts', '	
				jQuery(document).ready(function($) { 
					"use strict";
		
					/* Default Isotope Load Code */
					var $container = $(".progression-studios-video-index-list").isotope();
					$container.imagesLoaded( function() {
						$(".progression-masonry-item").addClass("opacity-progression");
						$container.isotope({
							itemSelector: ".progression-masonry-item",				
							percentPosition: true,
							layoutMode: "' . esc_attr(get_theme_mod( "progression_studios_blog_masonry_fit", "masonry")) . '" 
				 		});
					});
					/* END Default Isotope Code */
		
				});
			' 
			);

			
		}
		
	   
		
	}
	
	

}
add_action( 'wp_enqueue_scripts', 'progression_studios_enqueue_script' );