Skip to content

Instantly share code, notes, and snippets.

View PittsburghChris's full-sized avatar

Chris Field PittsburghChris

View GitHub Profile
@PittsburghChris
PittsburghChris / index.html
Created December 10, 2013 21:25
Make an image a circle using css
<div class="round-image"><img src="" alt=""></div>
@PittsburghChris
PittsburghChris / functions.php
Created December 5, 2013 20:14
Make the add_image_size you've placed into functions.php available on the Admin side on the Media Library
add_filter( 'image_size_names_choose', 'my_custom_sizes' );
function my_custom_sizes( $sizes ) {
return array_merge( $sizes, array(
'your-custom-size' => __('Your Custom Size Name'),
) );
}
@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;
}
@PittsburghChris
PittsburghChris / FiveBoxes
Created September 11, 2013 18:09
Genesis - adding slideshow widget area and 4 smaller widget areas
/* Display Slideshow */
add_action( 'genesis_before_content', 'fiveBox_homepage_slideshow' );
/* Display Feature Boxes */
add_action( 'genesis_before_content', 'fiveBox_do_features' );
/* Function Slideshow */
function fiveBox_homepage_slideshow() {
echo '<div class="slideshow widget">';
dynamic_sidebar( 'homepage-slideshow' );
<?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;
}
@PittsburghChris
PittsburghChris / gist:32dfc5abdb51e0ef7414
Created May 5, 2014 13:15
Wrap images with figure tag
// Wrap images with figure tag. Courtesy of Interconnectit http://interconnectit.com/2175/how-to-remove-p-tags-from-images-in-wordpress/
if( ! function_exists( 'reverie_img_unautop ' ) ) {
function reverie_img_unautop($pee) {
$pee = preg_replace('/<p>\\s*?(<a .*?><img.*?><\\/a>|<img.*?>)?\\s*<\\/p>/s', '<figure>$1</figure>', $pee);
return $pee;
} /* end reverie_img_unautop */
}