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 | |
//* Using the Gravity Forms editor, be sure to check "Allow field to be populated dynamically under Advanced Options | |
//* You will need to set the Field Parameter Name value to work with the filter as follows: gform_field_value_$parameter_name | |
//* Dynamically populate first name for logged in users | |
add_filter('gform_field_value_first_name', 'populate_first_name'); | |
function populate_first_name($value){ | |
global $current_user; | |
get_currentuserinfo(); | |
return $current_user->user_firstname; |
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 read more link after both manual excerpts and regular excerpts and customize link text for custom post types | |
add_filter('the_excerpt', 'amn_manual_excerpt_read_more_link'); | |
function amn_manual_excerpt_read_more_link($output) { | |
global $post; | |
if ( get_post_type() == 'my_custom_post_type_slug' ) { | |
$link_text = 'My CPT Read More Text'; | |
} else { | |
$link_text = 'Read More'; | |
} |
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 read more link after both manual excerpts and regular excerpts | |
add_filter('the_excerpt', 'amn_manual_excerpt_read_more_link'); | |
function amn_manual_excerpt_read_more_link($output) { | |
global $post; | |
return substr($output,0,-5).'... <a href="' . get_permalink($post->ID) . '">Read More</a>.</p>'; | |
} |
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 | |
//* Include custom post types in tag archive and category archive search results | |
add_filter( 'pre_get_posts', 'amn_get_posts' ); | |
function amn_get_posts( $query ) { | |
if ( ( is_tag() || is_category() ) && false == $query->query_vars['suppress_filters'] ) | |
$query->set( 'post_type', array( 'post', 'page', 'attachment', 'my_custom_post_type' ) ); | |
return $query; | |
} |
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 | |
//* Remove AddThis from specific custom post types | |
add_filter('addthis_post_exclude', 'amn_addthis_post_exclude_filter'); | |
function amn_addthis_post_exclude_filter($display) { | |
if ( in_array(get_post_type(), array('custom_post_type_1', 'custom_post_type_2','custom_post_type_3')) ) | |
$display = false; | |
return $display; | |
} |
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 | |
//* Customize Search Text | |
add_filter( 'genesis_search_text', 'amn_search_text'); | |
function amn_search_text() { | |
return esc_attr__( 'Search this website...', 'genesis' ); | |
} | |
//* Customize Search Form | |
add_filter( 'genesis_search_form', 'amn_search_form', 10, 4); | |
function amn_search_form( $form, $search_text, $button_text, $label ) { |
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 support for structural wraps | |
add_theme_support( 'genesis-structural-wraps', array( | |
'header', | |
'nav', | |
'subnav', | |
'site-inner', | |
'footer-widgets', | |
'footer' | |
) ); |
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 | |
//* Remove default Genesis "G" favicon | |
remove_action('genesis_meta', 'genesis_load_favicon'); // Genesis 1.9 | |
remove_action('wp_head', 'genesis_load_favicon'); // Genesis 2.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
<?php | |
//* Add excerpts post type support for pages | |
add_action('init', 'amn_page_excerpts'); | |
function amn_page_excerpts() { | |
add_post_type_support( 'page', 'excerpt'); | |
} |
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 custom image sizes to WordPress | |
add_image_size( 'featured', 690, 180, TRUE ); | |
add_image_size( 'full_width', 960); | |
add_image_size( 'grid', 300, 150, TRUE ); | |
add_image_size( 'small_thumbnail', 100, 100, TRUE ); | |
add_image_size( 'micro_thumbnail', 75, 75, TRUE ); | |
//* Make custom sizes available within the WordPress Media Library Attachment Display Settings | |
add_filter( 'image_size_names_choose', 'amn_image_sizes_choose' ); |
NewerOlder