This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isMapScrolledIntoView(elem) | |
{ | |
var $elem = $(elem); | |
var $window = $(window); | |
var docViewTop = $window.scrollTop(); | |
var docViewBottom = docViewTop + $window.height(); | |
var elemTop = $elem.offset().top; | |
var elemBottom = elemTop + $elem.height(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('wp_head','wppu15_home_custom_remove_action',1); | |
function wppu15_home_custom_remove_action() { | |
if( is_front_page() || is_home() ) { | |
remove_action( 'wp_footer', 'wppu_awesome_option_script_init' ); | |
remove_action( 'wp_enqueue_scripts', 'wppu_awesome_css_options_files' ); | |
remove_action( 'wp_head', 'wppu_awesome_css_options_markup_frontedn' ); | |
remove_action( 'wp_enqueue_scripts', 'wppu_pace_jquery_options_active_script_style' ); | |
remove_action( 'wp_head', 'wppu_pace_style_add__frontend' ); | |
remove_action( 'wp_head', 'wppu_pace_markup_add__frontend' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('wp_head','wppu15_archive_custom_remove_action',1); | |
function wppu15_archive_custom_remove_action() { | |
// please change product or service name if your post has different name | |
// this script will disable wppu preloader on your disable archive pages | |
if( is_post_type_archive( array('product', 'service') ) ) { | |
remove_action( 'wp_footer', 'wppu_awesome_option_script_init' ); | |
remove_action( 'wp_enqueue_scripts', 'wppu_awesome_css_options_files' ); | |
remove_action( 'wp_head', 'wppu_awesome_css_options_markup_frontedn' ); | |
remove_action( 'wp_enqueue_scripts', 'wppu_pace_jquery_options_active_script_style' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
if( $("#blogie--banner-slider").length > 0 ) { | |
var banner_slider = $("#blogie--banner-slider"); | |
banner_slider.owlCarousel({ | |
loop:true, | |
margin:10, | |
nav:true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.move-items.container .inner-container { | |
margin-left: calc((-100vw + 100%) / 2); | |
margin-right: calc((-100vw + 100%) / 2); | |
padding-left: calc((100vw - 100%) / 2); | |
padding-right: calc((100vw - 100%) / 2); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery | |
$(window).trigger('resize'); | |
// Javascript | |
window.dispatchEvent(new Event('resize')); | |
// Javascript support IE as well | |
var evt = window.document.createEvent('UIEvents'); | |
evt.initUIEvent('resize', true, false, window, 0); | |
window.dispatchEvent(evt); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/***** | |
- This is a template used by 6 posts within a CPT | |
- Each post contains some text in the content editor and an ACF Gallery. | |
- Each image is tagged with category(ies) using Enhanced Media Library plugin. | |
- The categories used on each page are being echoed out to provide a means to filter the images. | |
- The lightbox being used is http://photoswipe.com | |
- The filter is done with http://isotope.com | |
- Included with the Isotope integration is https://github.com/desandro/imagesloaded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery | |
$(".image-container > img").each(function(i, img) { | |
$(img).css({ | |
position: "relative", | |
left: ($(img).parent().width()/2) - ($(img).width()/2), | |
top: ($(img).parent().height()/2) - ($(img).height()/2), | |
}); | |
}); | |
<!-- html markup --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Detect if a WordPress plugin is active | |
* A function you can use to check if plugin is active/loaded for your plugins/themes | |
* @link //gist.github.com/llgruff/c5666bfeded5de69b1aa424aa80cc14f | |
*/ | |
// When coding plugins that rely on another one, like Private Content for bbPress or Visual Attributes for WooCommerce, you need to make if the WordPress Plugin is active to initialize your plugin routines or display a notice saying that the required plugin must be activated. In this tutorial we’ll see how to detect whether a certain plugin is active in a couple of ways. | |
## 1. Check whether a certain class or function or constant exists |