Skip to content

Instantly share code, notes, and snippets.

@RCowles
RCowles / functions.php
Created October 20, 2014 21:56
Add Publicize support for two CPTs (news and review).
add_action('init', '1974929_custom_init');
function 1974929_custom_init() {
add_post_type_support( 'news', 'publicize' );
add_post_type_support( 'review', 'publicize' );
}
@RCowles
RCowles / functionality-plugin.php
Created October 6, 2014 21:00
Modify jetpack-portfolio CPT labels
function jetpackme_portfolio_labels() {
register_post_type( 'jetpack-portfolio',
array(
'labels' => array(
'name' => __( 'Portfolio' ),
'singular_name' => __( 'Portfolio' )
),
)
}
add_action( 'init', 'jetpackme_portfolio_labels' );
@RCowles
RCowles / custom-functionality.php
Last active August 29, 2015 14:06
Change Jetpack Contact Form confirmation message
<?php
function 1939551_change_grunion_success_message( $msg ) {
global $contact_form_message;
return '<h3>' . 'My custom success message' . '</h3>' . wp_kses($contact_form_message, array('br' => array(), 'blockquote' => array()));;
}
add_filter( 'grunion_contact_form_success_message', '1939551_change_grunion_success_message' );
?>
@RCowles
RCowles / functionality-plugin.php
Created August 28, 2014 21:28
Add Publicize support to an existing CPT
add_action('init', 'rsc_custom_init');
function rsc_custom_init() {
add_post_type_support( 'your-custom-post-type-name', 'publicize' );
}
function rsc_cpt_permalink() {
$args = array(
'rewrite' => array('slug' => 'custom-slug')
);
register_post_type( 'portfolio', $args );
}
add_action( 'setup_theme', 'rsc_cpt_permalink' );
@media screen and (min-width : 901px) {
.single-post .content-area {
margin: 2% 4% 2% 6%;
width: 90%;
}
}
@RCowles
RCowles / custom.css
Created July 11, 2014 18:06
Remove border from sharing buttons
.sd-content li a span {
border: none;
display: inline;
}
/**
* 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' );
<?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
@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' );