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 MarkSocialIcons_Widget extends WP_Widget { | |
/** | |
* Register widget with WordPress. | |
*/ | |
public function __construct() { | |
parent::__construct( | |
'tb_social_icons', // Base ID |
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 infiniteInit(articleWrap, append, paginationWrap, loadMore){ | |
let infiniteWrap = $(articleWrap); | |
infiniteWrap.infiniteScroll({ | |
path: paginationWrap + ' .next', | |
append: articleWrap + " " + append, | |
button: loadMore, | |
history: false, | |
scrollThreshold: false, | |
hideNav: paginationWrap, | |
}); |
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
<?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(); |