Skip to content

Instantly share code, notes, and snippets.

View PittsburghChris's full-sized avatar

Chris Field PittsburghChris

View GitHub Profile
@PittsburghChris
PittsburghChris / functions.php
Last active December 29, 2015 00:29 — forked from studiopress/functions.php
How to add Google Fonts to an HTML5-compatible Genesis child theme after 2013.
<?php
//* Do NOT include the opening php tag
//* Enqueue Lato Google font
add_action( 'wp_enqueue_scripts', 'sp_load_google_fonts', 5);
function sp_load_google_fonts() {
wp_enqueue_style( 'google-font-lato', '//fonts.googleapis.com/css?family=Lato:300,700', array(), CHILD_THEME_VERSION );
}
/**
* Add CTA widget support for site. If widget not active, don't display
*
*/
function mp_cta_genesis() {
// Don't display the CTA on the home page, since it's built into the MP theme
if ( is_home() ) {
return;
}
<?php
//* Do NOT include the opening php tag
//* Modify the header URL
add_filter('genesis_seo_title', 'sp_seo_title', 10, 3);
function sp_seo_title($title, $inside, $wrap) {
$inside = sprintf( '<a href="http://www.yourdomain.com" title="%s">%s</a>', esc_attr( get_bloginfo('name') ), get_bloginfo('name') );
$title = sprintf('<%s id="title">%s</%s>', $wrap, $inside, $wrap);
return $title;
}