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 | |
/* | |
In the global scope | |
*/ | |
if(function_exists('acf_add_options_sub_page')) { | |
acf_add_options_sub_page(array( | |
'title' => 'Nourish-mint Options', | |
'parent' => 'themes.php' /* Name of Admin file to parent or path to custom plugin page */ | |
)); |
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 | |
$args = array( | |
'order' => 'ASC', | |
'meta_key' => 'user-is-coach', | |
'meta_value' => 'yes' | |
); | |
$coaches = new WP_User_Query($args); | |
$coaches = $coaches->results; | |
foreach($ordered_coaches as $coach) { |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
/* | |
Basset Theme | |
Template Enqueue Scratchwork | |
The idea is to allow a template file to declare it's own dependancies using a comment header similar to the style.css file or plugins. | |
*/ | |
// Template index.php | |
<?php | |
/* |
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 | |
// Extend wp_enqueue_script & wp_enqueue_style to support callbacks. | |
function beagle_enqueue_style_callback($handle = "script-name", $callback_fun, $callback_args, $enqueue_query = array()) {} | |
beagle_enqueue_style_callback('my-gallery-css', function() { | |
ob_start(); | |
?> | |
body { | |
background:red; |
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 | |
// I add a simple function to my functions.php that lets me do clean page-builder checks inside my template files. | |
// This is safe to include regardless of if bb-plugin is active or not. Won't trigger error. | |
function is_builder_layout() { | |
if (class_exists( 'FLBuilderModel' ) && FLBuilderModel::is_builder_enabled()) return true; | |
return false; | |
} | |
// Inside page.php I use is_builder_layout() to determine layout | |
if (is_builder_layout()) { |
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 | |
/** | |
* Adding a style variation to certain elements | |
*/ | |
add_filter('fl_theme_classes', function($classes, $type, $object) { | |
// Add a special row style | |
if ($type == 'row') { | |
$classes['dark-row'] = "Dark Row"; | |
} |