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
[ | |
{ | |
"key": "group_562025a91d355", | |
"title": "Hero Unit", | |
"fields": [ | |
{ | |
"key": "field_5620264fa0141", | |
"label": "Background Media", | |
"name": "background_media", | |
"type": "radio", |
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('acf_add_local_field_group') ): | |
acf_add_local_field_group(array ( | |
'key' => 'group_5525dfd96b4a0', | |
'title' => 'Brand Logo', | |
'fields' => array ( | |
array ( | |
'key' => 'field_5525dff1be331', |
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
add_filter( 'genesis_attr_site-container', 'ssm_data_off_canvas_content' ); | |
function ssm_data_off_canvas_content($attributes) { | |
$attributes['data'] = 'data-off-canvas-content'; | |
return $attributes; | |
} | |
// this creates <div class="site-container" data='data-off-canvas-content'></div> | |
// is there a way to do something like <div class="site-container" data-off-canvas-content></div> |
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 | |
/** | |
* Filter the Admin Column results | |
* | |
*/ | |
function my_cac_filtering_options_change_acf_label( $options, $column ) { | |
$column_type = 'column-acf_field'; // enter type of field. You can find this by hovering of the Type label of the column settings. | |
$field_label = 'Product Class'; // enter label of the ACF field. |
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
//Filter Through Store Nav | |
add_filter( 'wp_nav_menu_items', 'ssm_append_store_navigation', 10, 2 ); | |
function ssm_append_store_navigation ( $items, $args ) { | |
if ( do_shortcode('[cc_cart_item_count]') == 1 ) { | |
$cart_item = '<li class="right cart"><a href="' . get_bloginfo('url') . '/view_cart/">' . do_shortcode('[cc_cart_item_count]') . ' Item</a></li>'; | |
} else { | |
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
//* Force content-sidebar layout setting | |
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' ); |
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 | |
/** | |
* Retrieves the thumbnail from a youtube or vimeo video | |
* @param - $src: the url of the "player" | |
* @return - string | |
* @todo - do some real world testing. | |
* | |
**/ | |
function get_video_thumbnail( $src ) { |
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_action( 'genesis_after_header', 'ssm_insert_slideshow', 99 ); | |
/** | |
* Builds the HTML for the homepage slideshow | |
* | |
*/ | |
function ssm_insert_slideshow() { ?> | |
<?php if ( $slides = get_field( 'slides' ) ) { ?> |
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
add_filter( 'admin_body_class', 'ssm_home_admin_body_class' ); | |
/* | |
* Adds a body class to target the home page edit screen | |
* | |
*/ | |
function ssm_home_admin_body_class( $classes ) { | |
global $post; | |
$screen = get_current_screen(); | |
$homepage = get_page_by_title( 'Home' ); |
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 | |
/* | |
* Returns the first instance of a given layout option | |
* @param - $id - the id of the post you are trying to target: '' by default | |
* @param - $fc_field - the name of the ACF flexible field: 'content_blocks' as the default | |
* @param - $fc_layout - the name of the flexible content layout: 'visual_editor' as the default | |
* @return - mixed | |
* @todo - test different types of returned content. at the moment, I am only using this for returning a string | |
*/ | |
function get_first_instance_of_content_block( $id = '', $fc_field = 'content_blocks', $fc_layout = 'visual_editor' ) { |
NewerOlder