Skip to content

Instantly share code, notes, and snippets.

View wpspeak's full-sized avatar

WPSpeak wpspeak

View GitHub Profile
@wpspeak
wpspeak / functions.php
Last active December 18, 2015 14:08
Output a snapshot of any website!
<?php
// Output a snapshot of any website!
function wp_snap($atts, $content = NULL) {
extract(shortcode_atts(array(
"snap" => 'http://s.wordpress.com/mshots/v1/',
"url" => 'http://wpspeak.com/',
"alt" => 'WPSpeak',
"w" => '600', // width
@wpspeak
wpspeak / functions.php
Created June 19, 2013 07:01
Modify the size of the Gravatar in the author box
<?php
// Modify the size of the Gravatar in the author box
add_filter( 'genesis_author_box_gravatar_size', 'new_author_box_gravatar_size' );
function new_author_box_gravatar_size( $size ) {
return '96';
}
@wpspeak
wpspeak / functions.php
Created June 19, 2013 07:04
Modify the size of the Gravatar in the entry comments
<?php
// Modify the size of the Gravatar in the entry comments
add_filter( 'genesis_comment_list_args', 'custom_comments_gravatar' );
function custom_comments_gravatar( $args ) {
$args['avatar_size'] = 96;
return $args;
}
@wpspeak
wpspeak / annotated-style.css
Created June 19, 2013 07:24 — forked from GaryJones/annotated-style.css
Fix Genesis 2.0 CSS for Gist (Props Gary)
/* Same as other file, but with extra notes */
/* Embedded Gists */
.line-pre::before,
.line-pre::after,
.line::before,
.line::after {
content: ''; /* Fixes addition of float-clearing space added to before and after global pre and div elements */
}
@wpspeak
wpspeak / functions.php
Last active December 19, 2015 03:39
Anti Spam Mailto Links by Preventing Mail Scrapper Collecting the email
<?php
// Anti Spam Mailto Links
function email_encode_function($atts, $content){
return '<a href="'.antispambot($content).'">'.antispambot($content).'</a>';
}
add_shortcode('email', 'email_encode_function');
@wpspeak
wpspeak / functions.php
Created June 29, 2013 18:33
Link post title to external link - works best for link post format
<?php
// Link post title to external link
function afn_link_filter($link, $post) {
if (has_post_format('link', $post) && get_post_meta($post->ID, 'LinkFormatURL', true)) {
$link = get_post_meta($post->ID, 'LinkFormatURL', true);
}
return $link;
}
@wpspeak
wpspeak / functions.php
Created July 3, 2013 19:31
Add support for Post Formats
<?php
// Add support for post formats
add_theme_support( 'post-formats', array( 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video') );
@wpspeak
wpspeak / functions.php
Last active December 19, 2015 07:59
Add support for post format images
<?php
// Add support for post format images (for Genesis Framework only)
add_theme_support( 'genesis-post-format-images' );
@wpspeak
wpspeak / style.css
Last active December 19, 2015 09:09
Customizing WordPress Post Format
// Classes For Post Formats
.format-aside
.format-audio
.format-chat
.format-gallery
.format-image
.format-link
.format-quote
.format-status
@wpspeak
wpspeak / functions.php
Last active December 19, 2015 14:29
Exclude Post Formats from Blog
<?php
/**
* Exclude Post Formats from Blog
*
* @author Bill Erickson
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @param object $query data
*
*/