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
@font-face { | |
font-family: "freight-sans-pro"; | |
src: url("https://use.typekit.net/af/442215/000000000000000000010b5a/27/l?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("woff2"), | |
url("https://use.typekit.net/af/442215/000000000000000000010b5a/27/d?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("woff"), | |
url("https://use.typekit.net/af/442215/000000000000000000010b5a/27/a?primer=7cdcb44be4a7db8877ffa5c0007b8dd865b3bbc383831fe2ea177f62257a9191&fvd=n4&v=3") format("opentype"); | |
font-display: auto; | |
font-style: normal; | |
font-weight: 400; | |
font-stretch: normal; | |
} |
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 countDown(selector) { | |
var countDownElement = $(selector); | |
var startAt = parseFloat(countDownElement.attr('start-at')); | |
var endAt = parseFloat(countDownElement.attr('end-at')); | |
var animationDuration = parseFloat(countDownElement.attr('animation-duration').replace('ms', '')); | |
var currentValue = startAt; | |
var interval = 50; | |
var steps = (startAt - endAt) / (animationDuration / interval); | |
var timer = setInterval(function () { | |
currentValue -= steps; |
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 rl_cold_next_post_id( $post_id, $post_type ) { | |
global $post; | |
$oldGlobal = $post; | |
$post = get_post( $post_id ); | |
$previous_post = get_previous_post(); | |
$post = $oldGlobal; | |
if($previous_post == ""){ | |
return rl_cold_new_post_id($post_type); | |
} |
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 terrawise_exclude_first_post_from_query($query) { | |
if (!is_admin() && $query->is_main_query() && (is_home() || is_category())) { | |
if (!$query->get('exclude_first_post')) { | |
$first_post = get_posts(array( | |
'post_type' => 'post', | |
'post_status' => 'publish', | |
'posts_per_page' => 1, | |
)); | |
if (!empty($first_post)) { |
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
<script> | |
(function($){ | |
$(document).ready(function(){ | |
$('#divisiondiv .selectit').on('click', function(event){ | |
var targetElement = event.target; | |
if($(targetElement).prop("tagName") == 'INPUT'){ | |
var elements = $('#divisiondiv .selectit').find('input[type="checkbox"]'); | |
$(elements).each(function(){ | |
if(targetElement != this){ |
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_customize_init(){ | |
// Redirect any user trying to access comments page | |
global $pagenow; | |
if ($pagenow === 'edit-comments.php') { | |
wp_safe_redirect(admin_url()); | |
exit; | |
} | |
// Remove comments metabox from dashboard |
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 | |
// 1.Write a PHP function to sort an array of strings by their length, in ascending order. | |
function sort_strings_by_length($arrayItem) { | |
usort($arrayItem, function($a, $b) { | |
return strlen($a) - strlen($b); | |
}); | |
return $arrayItem; | |
} | |
$strings = array("apple", "banana", "cherry", "date", "elderberry"); | |
$sorted_strings = sort_strings_by_length($strings); |
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, | |
}); |
NewerOlder