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
<div class="rb-slider swiper-container"> | |
<!-- Slider main container --> | |
<div class="swiper"> | |
<!-- Additional required wrapper --> | |
<div class="swiper-wrapper"> | |
<!-- Slides --> | |
{% for block in section.blocks %} | |
<div class="swiper-slide"> | |
<img src="{{ block.settings.image | image_url }}" /> | |
</div> |
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 strip_html_tags( $text ) | |
{ | |
$text = preg_replace( | |
array( | |
// Remove invisible content | |
'@<head[^>]*?>.*?</head>@siu', | |
'@<style[^>]*?>.*?</style>@siu', | |
'@<script[^>]*?.*?</script>@siu', | |
'@<object[^>]*?.*?</object>@siu', | |
'@<embed[^>]*?.*?</embed>@siu', |
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 rbMouse = { | |
x: 0, | |
y: 0 | |
}; | |
$(document).on('mousemove', function(evt){ | |
rbMouse = { | |
x: evt.clientX, | |
y: evt.clientY | |
} | |
}); |
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_shortcode( 'dwqa-list-questions-with-taxonomy', 'dwqa_archive_question_shortcode' ); | |
function dwqa_archive_question_shortcode( $atts ) { | |
global $script_version, $dwqa_sript_vars; | |
extract( shortcode_atts( array( | |
'taxonomy_category' => '',//Use slug | |
'taxonomy_tag' => '',//Use slug | |
), $atts, 'bartag' ) ); | |
ob_start( array( $this, 'sanitize_output' ) ); |
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
$('.stretch-text').each(function(index, el) { | |
var line = $(el); | |
line.html('<span class="stretch-it">'+line.text()+'</span>'); | |
var text = line.find('.stretch-it' ); | |
var textLength = line.text().length, | |
textWidth = text.width(); | |
var spacing = line.width() - textWidth; | |
var lt_spacing = spacing / textLength; |
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
<div id="rb-follow-button"></div> | |
<script> | |
window.twttr = (function (d,s,id) { | |
var t, js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) return; js=d.createElement(s); js.id=id; | |
js.src="https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); | |
return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } }); | |
}(document, "script", "twitter-wjs")); | |
twttr.ready(function(twttr){ |
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 ondrag = false, | |
pointStart = lastPoint = distance = currentTranslate = 0; | |
$(window).on('mousedown mousemove mouseup touchmove touchstart touchend',function(event){ | |
console.log( event ); | |
switch(event.type) { | |
case 'touchstart': | |
case 'mousedown': | |
ondrag = true; | |
pointStart = lastPoint = event.pageX || event.originalEvent.touches[0].pageX; | |
break; |
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 rb_add_role( $allcaps, $caps, $args ){ | |
global $post; | |
if( 'edit_comment' == $args[0] ) { | |
foreach ($caps as $cap) { | |
if( ! array_key_exists($cap, $allcaps) ) { | |
$allcaps[$cap] = 1; | |
} | |
} | |
} | |
return $allcaps; |
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
/*-----------------------------------------------------------------------------------*/ | |
/* Get newest post day of each category | |
/*-----------------------------------------------------------------------------------*/ | |
if ( !function_exists( 'wallpress_is_new_post' ) ) : | |
function wallpress_is_new_post( $post_id ) { | |
//Get newest point of time of each category, must be newest and lessthan 3 days | |
$categories = get_the_category( $post_id ); | |
foreach ( $categories as $category ) { | |
$date = wallpress_newest_post_category( $category->cat_ID ); | |
$post_date = get_the_time( 'Y-m-d', $post_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
//Trick allow user subscriber can edit comment | |
function nex_update_cap($allcaps){ | |
//print_r($allcaps); | |
global $comment; | |
if( !empty($comment) ){ | |
global $current_user; | |
if( $current_user->ID == $comment->user_id ){ | |
$allcaps['edit_others_posts'] = 1; | |
$allcaps['edit_published_posts'] = 1; |
NewerOlder