Skip to content

Instantly share code, notes, and snippets.

View rfmeier's full-sized avatar
💭
Nada.

Ryan Meier rfmeier

💭
Nada.
View GitHub Profile
@rfmeier
rfmeier / functions.php
Last active October 10, 2015 06:47
my_post_updated_messages filter
<?php
// do not include php tag
add_filter( 'post_updated_messages', 'my_post_updated_messages' );
/**
* Callback for WordPress 'post_updated_messages' filter.
*
* @param array $messages The array of messages.
* @return array $messages The array of messages.
*/
@rfmeier
rfmeier / functions.php
Last active December 11, 2015 05:08
Including parent style.css file in a TwentyTwelve child theme.
<?php
/**
* Callback for WordPress 'wp_enqueue_scripts' action.
*
* This callback is executed before the parent theme (TwentyTwelve)
* 'wp_enqueue_scripts' callback is executed. This is due to the fact
* that the child theme functions.php is loaded before the parent functions.php
* file.
*
@rfmeier
rfmeier / functions.php
Last active December 16, 2015 19:39
Redirect a to a specific page depending on whether the user is authenticated or not.
<?php
/**
* Callback for WordPress 'template_redirect' action.
*
* http://codex.wordpress.org/Plugin_API/Action_Reference/template_redirect
*
* @return none
*/
function my_custom_redirect(){
@rfmeier
rfmeier / style.css
Last active December 17, 2015 19:49
Genesis 2.0 Beta and gist shortcodes
pre.line-pre:before,
pre.line-pre:after{
content:"";
}
div.line:before,
div.line:after{
content:"";
}
@rfmeier
rfmeier / functions.php
Last active June 28, 2016 23:13
Remove Jetpack sharedaddy 'the_content' filter.
<?php
//* do not include php tags
add_action( 'init', 'custom_init', 11 );
/**
* Callback for WordPress 'init' action.
*
* Remove the 'the_content' filter callback added by sharedaddy
* to prevent the sharing links from being appended to the posts content.
*
@rfmeier
rfmeier / functions.php
Last active January 19, 2016 05:20
Create a custom content box with Genesis Framework.
<?php
//* no not include php tags
add_action( 'genesis_after_entry', 'sharedaddy_box_genesis_after_entry', 5 );
/**
* Callback for Genesis Framework 'genesis_after_entry' action.
*
* Create a custom box for sharedaddy links.
*
* Note: Set add_action() priority to accommodate your theme.
@rfmeier
rfmeier / style.css
Last active December 17, 2015 21:09
Sharedaddy box styling.
/* sharedaddy box styling */
.sharedaddy-box{
background: #fff;
margin-bottom: 40px;
margin-bottom: 4rem;
border: solid 1px #dedede;
}
.sharedaddy-box{
@rfmeier
rfmeier / functions.php
Last active January 19, 2016 05:21
Alter the sharedaddy box title.
<?php
//* do not include php tags
add_filter( 'sharedaddy_box_title', 'custom_sharedaddy_box_title', 10, 2 );
/**
* Callback for RFMeier-Genesis 'sharedaddy_box_title' filter.
*
* Alter the sharedaddy box title.
*
* @since 0.2
@rfmeier
rfmeier / functions.php
Created June 2, 2013 22:00
Display random posts on the home page in WordPress
<?php
add_action( 'pre_get_posts', 'display_random_posts' );
/**
* Callback for WordPress 'pre_get_posts' action.
*
* @link http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts
* @author Ryan Meier <rfmeier@gmail.com>
*
* @param object $query The current query object
@rfmeier
rfmeier / functions.php
Last active December 18, 2015 00:39
Display content after every 3rd post entry in the loop with Genesis
<?php
/** pre Genesis 2.0 */
add_action( 'genesis_after_post', 'custom_genesis_after_post' );
/** Genesis 2.0+ */
add_action( 'genesis_after_entry', 'custom_genesis_after_entry' );
/**
* Callback for Genesis 'genesis_after_entry' action.
*