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 | |
/** | |
* Hooking into the CFS Select field and filling it with whatever options we want | |
*/ | |
/** | |
* Unfortunately, there only seems to be a hook for ALL OF THE FIELDS! | |
*/ | |
add_filter( 'cfs_pre_render_fields', 'iso_override_select' ); | |
function iso_override_select( $input_fields ) { |
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 | |
/** | |
* Sort some cats' posts by meta_key but not all | |
*/ | |
function iso_some_cats_are_so_meta( $query ) { | |
// I'd replace the following with something that isn't hard-coded | |
// If you're already using ACF, maybe an Options page that makes you select the categories | |
// And then get_option() that option to fill the following array |
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 | |
/** | |
* Quickie trick to make managing <option> loops easier | |
*/ | |
/** | |
* If you store all your options in an array, the output code will be easier to maintain | |
* You also won't have to worry about typos when creating new <option>s | |
*/ | |
$options = array( |
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
; | |
MyObject = typeof MyObject === 'undefined' ? {} : MyObject; | |
(function ($) { | |
$.noConflict(); | |
MyObject.module1 = { | |
init : function () { | |
var _this = MyObject.module1; |
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 | |
/** | |
* Let's say that the vids are a bunch of thumbs. | |
* I'll loop through them with something like | |
*/ | |
$specialty_video_oembed = get_sub_field( 'specialty_video_oembed' ); | |
$specialty_video_oembed_data = empty( $specialty_video_oembed ) ? '' : esc_attr( $specialty_video_oembed ); | |
$specialty_thumbnail = get_sub_field( 'specialty_thumbnail' ); |
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 | |
// Getting the array | |
$product_group = rwmb_meta( 'products' ); | |
/** | |
* Keys = | |
* $product_group = rwmb_meta( 'products'); | |
* 'sw_swsku'; | |
* 'sw_swdescription'; |
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
<html class="no-js"> | |
<head> | |
<script> | |
(function (doc, classToAdd) { | |
doc.className = (doc.className).replace("no-js", classToAdd); | |
})(document.documentElement, "js"); | |
</script> |
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 | |
add_action( 'wp_enqueue_scripts', 'ss_enqueue_scripts' ); | |
function ss_enqueue_scripts() { | |
wp_enqueue_script( 'isotope', get_stylesheet_directory_uri() . '/js/isotope.pkgd.min.js', array(), CHILD_THEME_VERSION, true ); | |
wp_enqueue_script( 'steve-stuff', get_stylesheet_directory_uri() . '/js/filters.js', array( 'jquery', 'isotope' ), '0.1' , true ); | |
} |