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
jQuery( '.chooser' ).on( 'click' , function( event ) { | |
var $this = jQuery(this); | |
var term = $this.data('term'); | |
if ( $this.hasClass( 'uk-button-primary' ) ) { | |
var $unterm = jQuery( '.shadow[data-term="' + term + '"]' ); | |
UIkit.filter('[uk-filter="target: .js-filter"]', { target: ".js-filter" } ).apply( $unterm ); | |
} else { | |
UIkit.filter('[uk-filter="target: .js-filter"]', { target: ".js-filter" } ).apply( $this ); | |
} |
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
{% macro getterms( taxonomy ) %} | |
{% set terms = function( 'get_terms' , { 'taxonomy': taxonomy , 'hide_empty' : true } ) %} | |
{% for item in terms %} | |
{% if item.slug != 'uncategorized' %} | |
<div> | |
<ul class="uk-subnav uk-subnav-pill" uk-margin> | |
<li class="filterbutton" uk-filter-control="filter: [data-{{item.slug}}='true']; group: {{item.slug}}"> | |
<a href="#">{{item.name}}</a> | |
</li> | |
</ul> |
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_filter( 'toolbox/helpers/settings/type=relationship' , 'my_relationship_settings' , 10, 2 ); | |
function my_relationship_settings( $settings , $type = '' ) { | |
return array_merge($settings , array( | |
'relationship_subfield' => array( | |
'type' => '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 | |
/** | |
* Write the data to a file | |
* | |
* @param [type] $filename [description] | |
* @param [type] $data [description] | |
* @return [type] [description] | |
*/ | |
function writedata( $filename, $data ) { |
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
<html> | |
<head> | |
<title>Youtube defer loading</title> | |
<!-- CSS --> | |
<style> | |
.youtube { | |
background-color: #000; | |
margin-bottom: 30px; | |
position: relative; | |
padding-top: 56.25%; |
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 | |
/** | |
* return number_formatted fieldvalue by adding classes to number field in Field Group | |
* | |
* my-currency : return as formatted number 1999 becomes 1,999 | |
* my-currency-dec-# : set the number of decimals to return, # is the number of decimals (needs at least one character) | |
*/ | |
add_filter( 'acf/load_value/type=number', 'my_check_number_classes', 10, 3 ); |
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 | |
/** | |
* STEP 1: add code below to functions.php | |
* | |
* STEP 2: after adding this code you can add the fields to a block called My Custom Block. | |
* It will be available to select in the ACF Plugin AFTER this code has been added. | |
* | |
* Add these fields to the Fieldgroup for this block: | |
* |
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_filter( 'toolbox/helpers/sc_attr/type=image' , 'add_image_class_attr' , 10 ,1 ); | |
// add a custom attribute named 'myclass' | |
function add_image_class_attr( $attr ) { | |
$attr['myclass'] = ''; | |
return $attr; | |
} |
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_filter( 'toolbox/helpers/sc_attr/type=new_fieldtype', 'my_own_attr_defaults' , 10 , 1 ); | |
function my_own_attr_defaults ( $attr = array() ) { | |
$new_attr = array( | |
'field' => '', | |
'format' => null, | |
'allowempty' => 'false', | |
'postid' => 0, |