View acf-hero-unit.json
[ | |
{ | |
"key": "group_562025a91d355", | |
"title": "Hero Unit", | |
"fields": [ | |
{ | |
"key": "field_5620264fa0141", | |
"label": "Background Media", | |
"name": "background_media", | |
"type": "radio", |
View acf-options-page-fields.php
<?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', |
View data-attributes.php
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> |
View acf-cac.php
<?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. |
View cart66-viewcart.php
//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 { | |
View layout.php
//* Force content-sidebar layout setting | |
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' ); |
View get-video-thumbnail.php
<?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 ) { |
View acf-soliloquy.php
<?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' ) ) { ?> |
View admin-body-class-home.php
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' ); |
View gist:9f0a93a9953361edb7bb
<?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