This file contains hidden or 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 | |
if ( ! function_exists( 'rtcamp_add_img_alt_attribute' ) ) { | |
/** | |
* Filter attachment image attributes to inject alt attribute. | |
* | |
* @param string[] $attrs Array of attribute values for the image markup, keyed by attribute name. | |
* @param WP_Post|null $attachment Image attachment post. | |
* @return string[] Filtered attributes. | |
*/ |
This file contains hidden or 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( 'ready', () => { | |
$( '.slider-nav' ).slick( { | |
responsive: [ | |
{ | |
breakpoint: 767, | |
settings: { | |
dots: true, | |
customPaging: function( slick, index ) { | |
var targetImage = slick.$slides.eq( index ).find( 'img' ).attr( 'src' ); | |
return '<button><img src=" ' + targetImage + ' " alt="image" /></button>'; |
This file contains hidden or 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
$( '<ul id="bp-members-order-by" class="bs-dropdown bs-dropdown-order" />' ).appendTo( '#bp-members-order-select' ); | |
$( '#members-order-by option' ).each(function() { | |
var el = $(this); | |
$('<li />', {}).appendTo( '#bp-members-order-by' ); | |
$('<a />', { | |
'href' : el.attr( 'value' ), | |
'text' : el.text() |
This file contains hidden or 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 | |
/** | |
* Fix Gravity Form Tabindex Conflicts | |
*/ | |
if ( !function_exists( 'gform_tabindexer' ) ) { | |
function gform_tabindexer( $tab_index, $form = false ) { | |
$starting_index = 1000; | |
if ( $form ) { |
This file contains hidden or 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( $, window, document, undefined ) | |
{ | |
$.fn.doubleTapToGo = function( params ) | |
{ | |
if( !( 'ontouchstart' in window ) && | |
!navigator.msMaxTouchPoints && | |
!navigator.userAgent.toLowerCase().match( /windows phone os 7/i ) ) return false; | |
this.each( function() | |
{ |
This file contains hidden or 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 | |
if ( has_post_thumbnail( $post_id ) ) { | |
// Get Featured Image | |
$class = 'img-thumb'; | |
$post_thumbnail_id = get_post_thumbnail_id( $post_id ); | |
$image_exists = wp_get_attachment_image_src( $post_thumbnail_id, 'thumbnail-size' ); | |
if ( !$image_exists[ 3 ] ) { | |
$class = 'img-not-thumb'; | |
} |
This file contains hidden or 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
.img-parent img { | |
position: relative; | |
overflow: hidden; | |
padding-bottom: 69.44%; /* Calculated = height / width * 100 */ | |
display: block; | |
} | |
.img-parent img { | |
position: absolute; | |
top: 0; |
This file contains hidden or 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 to trim excerpt | |
*/ | |
if ( !function_exists( 'limit_excerpt' ) ) { | |
function limit_excerpt( $lenght, $text ) { | |
$content = substr( $text, 0, $lenght ); | |
if ( strlen( $content ) < strlen( $text ) ) { |
This file contains hidden or 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 | |
// Add class to body in admin section | |
function admin_body_classes($classes) { | |
$classes .= 'no-adminbar'; | |
return $classes; | |
} | |
add_filter( 'admin_body_class', 'admin_body_classes' ); |
This file contains hidden or 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
.clearfix:before, | |
.clearfix:after { | |
flex-basis: 0; | |
order: 1; | |
} |
NewerOlder