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 | |
/* @link https://anythinggraphic.net/yoast-seo-add-custom-social-share-images-for-archive-category-pages-in-wordpress | |
/* Add custom Twitter Social Share images for Yoast SEO for Archive pages | |
----------------------------------------------------------------------------------------*/ | |
add_filter( 'wpseo_twitter_image', 'ag_yoast_seo_tw_share_images', 10, 1 ); | |
function ag_yoast_seo_tw_share_images( $img ) { | |
if( is_post_type_archive( 'archivename') ) { | |
$img = get_stylesheet_directory_uri().'/images/your-image-file.jpg'; | |
} | |
if( is_category( 'categoryname') ) {{ |
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 | |
add_action( 'genesis_entry_header', 'ag_header_wrap_open', 5 ); | |
function ag_header_wrap_open() { | |
echo '<div class="wrap align-center">'; | |
} | |
add_action( 'genesis_entry_header', 'ag_header_wrap_close', 14 ); | |
function ag_header_wrap_close() { | |
echo '</div>'; |
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 | |
/* @link https://anythinggraphic.net/change-header-logo-link-in-genesis-updated-for-html5-schema/ | |
/* Updated from Bill Erickson's original post http://www.billerickson.net/code/genesis-change-logo-url to include support for new HTML5 themes and schema rich snippets. | |
/* Change header logo link in Genesis | |
----------------------------------------------------------------------------------------*/ | |
add_filter('genesis_seo_title', 'ag_change_logo_url', 10, 3 ); | |
function ag_change_logo_url( $title, $inside, $wrap ) { | |
$inside = sprintf( '<a href="%s" title="%s">%s</a>', esc_url( 'http://nmbree.org' ), esc_attr( get_bloginfo( 'name' ) ), get_bloginfo( 'name' ) ); | |
$title = sprintf( '<%s class="site-title" itemscope="headline">%s</%s>', $wrap, $inside, $wrap ); |
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 | |
/* @link https://anythinggraphic.net/change-class-id-itemtype-and-other-attributes-in-genesis/ | |
/* Change microdata for Article with the class 'entry' in Genesis child themes | |
----------------------------------------------------------------------------------------*/ | |
add_filter( 'genesis_attr_entry', 'ag_article_attributes', 20 ); | |
function ag_article_attributes( $attributes ) { | |
if( is_singular( 'leadership' ) ) { | |
// class, id, itemscope, itemtype, etc. | |
$attributes['itemtype'] = 'http://schema.org/Organization'; |
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 | |
/* @link https://anythinggraphic.net/change-navigation-menu-item-url-itemtype-schema-microdata/ | |
/* Change microdata for specific menu items | |
----------------------------------------------------------------------------------------*/ | |
add_filter( 'nav_menu_link_attributes', 'ag_menu_item_attributes', 10, 3 ); | |
function ag_menu_item_attributes( $atts, $item, $args ) { | |
// The ID of the target menu item | |
// Remove this to target all menu items | |
$menu_target = 123; |
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 | |
/* @link https://anythinggraphic.net/header-image-logo-in-genesis-and-wordpress-with-a-retina-2x-version/ | |
/* Override Header Image (Appearance > Customize) with an @2x version | |
----------------------------------------------------------------------------------------*/ | |
add_theme_support( 'custom-header', array( | |
'header_image' => '', | |
'header-selector' => '.site-title a', | |
'header-text' => false, | |
'height' => 188, |
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 | |
/* Move Post Title and Post Info from inside Entry Header to Entry Content on Posts page | |
----------------------------------------------------------------------------------------*/ | |
add_action( 'genesis_before_entry', 'reposition_entry_header' ); | |
function reposition_entry_header() { | |
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 ); | |
remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); | |
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); | |
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 ); |
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
/* Change the description of Gravity Forms/Stripe Form Stripe Receipt (product) | |
----------------------------------------------------------------------------------------*/ | |
add_filter( 'gform_stripe_charge_description', 'ag_custom_product_receipt', 10, 4 ); | |
function ag_custom_product_receipt( $description, $strings, $entry, $submission_data ) { | |
$payment_amount = rgar( $submission_data, 'payment_amount' ); | |
$description = "Payment Amount: " . $payment_amount; | |
GFCommon::log_debug( __METHOD__ . "(): Custom description for the product: " . $description ); |
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 | |
/* @link TBA | |
/* Within your custom loop, get all taxonomies for a custom post type (CPT) and display each post within those taxonomies | |
----------------------------------------------------------------------------------------*/ | |
$post_type = 'your_cpt_name'; | |
// Get all of the taxonomies for this post type | |
$taxonomies = get_object_taxonomies((object) array( 'post_type' => $post_type )); ?> |
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
/* | |
Original link http://www.templatemonster.com/blog/style-radioes-radio-buttons-css adapted to Gravity Forms. | |
Uses Font Awesome. Make sure to wrap labels in <span> like so: | |
<script type="text/javascript"> | |
jQuery(function($) { | |
$(".gfield_checkbox label, .gfield_radio label").wrapInner("<span></span>") | |
}); | |
</script> | |
*/ |