Skip to content

Instantly share code, notes, and snippets.

@RCowles
RCowles / gist:6528167
Created September 11, 2013 18:57
Change Jetpack Contact Form success message
function rsc_change_grunion_success_message( $msg ) {
global $contact_form_message;
return '<h3>' . 'Thank you!' . '</h3>' . wp_kses($contact_form_message, array('br' => array(), 'blockquote' => array()));;
}
add_filter( 'grunion_contact_form_success_message', 'rsc_change_grunion_success_message' );
@RCowles
RCowles / functions.php
Created December 20, 2013 23:13
Customize the output of wp_get_shortlink to replace all shortlinks with standard permalinks.
function tweakjp_cust_shortlink() {
global $post;
if ( !$post )
return;
return get_permalink($post->ID);
}
add_filter( 'get_shortlink', 'tweakjp_cust_shortlink' );
@RCowles
RCowles / custom.css
Created January 16, 2014 22:18
Increase the thumbnail size for Jetpack's Tops Posts & Pages widget.
#widgets .widget_top-posts .widgets-list-layout-blavatar {
max-width: 600px;
}
nav,
footer {
background: #fff;
}
add_filter( 'the_content', array( 'Jetpack_RelatedPosts', 'filter_add_target_to_dom' ), 40 );
@RCowles
RCowles / custom.css
Last active August 29, 2015 13:57
Correct overlapping RP thumbs on Windows Phone
@media only screen and (max-width: 320px) {
div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post {
width: 100% !important;
}
}
<?php
/*
Plugin Name: Facebook Featured Image and Open Graph Meta Tags
Version: 1.0.1
Plugin URI: http://ryanscowles.com/2013/01/set-wordpress-featured-image-thumbnail/
Description: This plugin will add the necessary Open Graph Meta tags to automatically set the posts' Featured Image as the thumbnail for sharing on Facebook and LinkedIn. It will also set Open Graph Meta tags for title, description, URL, type, and site name.
Author: Ryan S. Cowles
Author URI: http://www.ryanscowles.com
License: GPL2
@RCowles
RCowles / disable-og-tags.php
Created June 9, 2014 19:30
A filter to remove Jetpack's Open Graph meta tags
add_filter( 'jetpack_enable_open_graph', '__return_false' );
<?php
/*
Plugin Name: RSC Functionality Plugin
Plugin URI: http://ryanscowles.com
Description: A plugin that contains all site specific functionality for YOUR SITE
Version: 0.1
Author: Ryan Cowles
Author URI: http://ryanscowles.com
License: GPL2
/**
* 1.0 Enqueue Scripts
*
* Enqueue custom scripts for GearBottle.com
*/
function gearbottle_enqueue_script() {
wp_enqueue_script( 'ads', '//example.com/script.js', false); // Ads script
}
add_action( 'wp_enqueue_scripts', 'gearbottle_enqueue_script' );