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 | |
function devrupash_remove_max_srcset_image_width( $max_width ) { | |
return false; | |
} | |
add_filter( 'max_srcset_image_width', 'devrupash_remove_max_srcset_image_width' ); | |
function devrupash_disable_srcset( $sources ) { | |
return false; | |
} | |
add_filter( 'wp_calculate_image_srcset', 'devrupash_disable_srcset' ); |
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 | |
function get_page_id_by_template($page_template_filename){ | |
$pages = get_pages( array( | |
'meta_key' => '_wp_page_template', | |
'meta_value' => $page_template_filename | |
) ); | |
$pageIds = array(); | |
foreach($pages as $page){ | |
$pageId = $page->ID; | |
array_push($pageIds, $pageId); |
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
//viewport check & display animation | |
$.fn.isInViewport = function() { | |
var elementTop = $(this).offset().top; | |
var elementBottom = elementTop + $(this).outerHeight(); | |
var viewportTop = $(window).scrollTop(); | |
var viewportBottom = viewportTop + $(window).height(); | |
return elementBottom > viewportTop && elementTop < viewportBottom; | |
}; | |
let elements = $('.animateUpAnimation'); |
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 | |
class RGB { | |
private $color; | |
private $red; | |
private $green; | |
private $blue; | |
public function __construct( $colorCode = '' ) { | |
$this->color = ltrim($colorCode, "#" ); | |
$this->parseColor(); | |
} |
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
/* Medium Layout: 992 to 1200px. */ | |
@media only screen and (min-width: 992px) and (max-width: 1200px) { | |
} | |
/* Tablet Layout: 768px to 991px */ | |
@media only screen and (min-width: 768px) and (max-width: 991px) { | |
} | |
/* Tablet & Mobile Layout: 991px */ | |
@media only screen and (max-width: 991px) { |
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 | |
function rw_breadcrumbs() { | |
$showOnHome = 0; // 1 - show breadcrumbs on the homepage, 0 - don't show | |
$delimiter = '/'; // delimiter between crumbs | |
$home = 'Home'; // text for the 'Home' link | |
$showCurrent = 1; // 1 - show current post/page title in breadcrumbs, 0 - don't show | |
$before = '<li class="active">'; // tag before the current crumb | |
$after = '</li>'; // tag after the current crumb | |
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 ts_quantity_plus_sign() { | |
echo '<button type="button" class="plus" >+</button>'; | |
} | |
add_action( 'woocommerce_before_add_to_cart_quantity', 'ts_quantity_minus_sign' ); | |
function ts_quantity_minus_sign() { | |
echo '<button type="button" class="minus" >-</button>'; | |
} | |
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 | |
$orderby = 'name'; | |
$order = 'asc'; | |
$hide_empty = false ; | |
$cat_args = array( | |
'orderby' => $orderby, | |
'order' => $order, | |
'hide_empty' => $hide_empty, | |
); | |
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
var headerheight = $('#header_sticky').height(); | |
$(window).on('scroll', function () { | |
var scroll = $(window).scrollTop(); | |
if (scroll < headerheight) { | |
$("#header_sticky").removeClass("sticky_bar"); | |
} else { | |
$("#header_sticky").addClass("sticky_bar"); | |
} | |
}); |
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
$(document).on('click', 'selector', function() { | |
var range = document.createRange(); | |
var selector = $(this).next(".data")[0]; | |
var statusSelector = $(this).prev('.copy-status'); | |
console.log(statusSelector); | |
range.selectNode(selector); | |
window.getSelection().removeAllRanges(); | |
window.getSelection().addRange(range); | |
document.execCommand("copy"); | |
window.getSelection().removeAllRanges(); |