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
(function($){ | |
/** | |
* initializeBlock | |
* | |
* Adds custom JavaScript to the block HTML. | |
* | |
* @date 10/11/21 | |
* @since 1.0.0 | |
* |
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
$(document).keypress(function(event){ | |
var keycode = (event.keyCode ? event.keyCode : event.which); | |
if(keycode == '13'){ | |
if($('.facetwp-search').is(":focus")){ | |
FWP.refresh(); | |
} | |
} | |
}); |
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('edac_filter_readability_content', 'edadc_custom_readability_content', 1, 2); | |
function edadc_custom_readability_content($content, $post_id){ | |
$content .= get_field('my_custom_field',$post_id); | |
return $content; | |
} |
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 custom avatar size to Genesis user profile widget | |
add_filter( 'genesis_gravatar_sizes', 'sjd_user_profile' ); | |
function sjd_user_profile( $sizes ) { | |
$sizes['Extra Large Image'] = 200; | |
return $sizes; | |
} |
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
// Change featured image size on a specific archive page | |
function sjd_custom_loop_image_size( $image_size ) { | |
if(is_archive('testimonial')){ | |
$image_size = 'content-slider'; | |
return $image_size; | |
} | |
} | |
add_filter( 'genesis_pre_get_option_image_size', 'sjd_custom_loop_image_size' ); |
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
function sjd_acf_input_admin_footer() { | |
?> | |
<script type="text/javascript"> | |
(function($) { | |
acf.add_filter('color_picker_args', function( args, $field ){ | |
// add the hexadecimal codes here for the colors you want to appear as swatches | |
args.palettes = ['#ffffff','#000000'] |
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('enter_title_here', 'my_title_place_holder' , 20 , 2 ); | |
function my_title_place_holder($title , $post){ | |
if( $post->post_type == 'pet' ){ | |
$my_title = "Animal Name"; | |
return $my_title; | |
} | |
return $title; | |
} |
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
/* | |
Admin Branding | |
*/ | |
$admin_branding_url = get_stylesheet_directory() . '/includes/admin-branding.php'; | |
if(file_exists($admin_branding_url)) { | |
include_once($admin_branding_url); | |
} |
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('next_posts_link_attributes', 'posts_link_attributes'); | |
add_filter('previous_posts_link_attributes', 'posts_link_attributes'); | |
function posts_link_attributes() { | |
return 'class="button"'; | |
} |