Skip to content

Instantly share code, notes, and snippets.

@reasonstousegenesis
reasonstousegenesis / functions.php
Last active August 29, 2015 14:20
Output the 'last updated' date with Genesis
<?php
// Paste the code BELOW this line into your child theme functions.
/**
* Output the 'last updated' date with Genesis
*
* @author Reasons to Use Genesis
* @link http://reasonstousegenesis.com/last-updated-date/
*/
add_filter( 'genesis_post_info', 'rtug_last_updated_date' );
@reasonstousegenesis
reasonstousegenesis / functions.php
Last active August 29, 2015 14:20
Output the year a Post or Page was last updated
<?php
// Paste the code BELOW this line into your child theme functions.
/**
* Output the year a Post or Page was last updated
*
* @author Reasons to Use Genesis
* @link http://reasonstousegenesis.com/last-updated-date/
*/
add_filter( 'genesis_post_info', 'rtug_last_updated_date_custom' );
@reasonstousegenesis
reasonstousegenesis / functions.php
Last active August 29, 2015 14:20
Output the 'last updated' date in relative terms
<?php
// Paste the code BELOW this line into your child theme functions.
/**
* Output the 'last updated' date in relative terms
*
* @author Reasons to Use Genesis
* @link http://reasonstousegenesis.com/last-updated-date/
*/
add_filter( 'genesis_post_info', 'rtug_last_updated_date_relative' );
@reasonstousegenesis
reasonstousegenesis / functions.php
Last active August 29, 2015 14:20
Output the 'last updated' date with extra content
<?php
// Paste the code BELOW this line into your child theme functions.
/**
* Output the 'last updated' date with extra content
*
* @author Reasons to Use Genesis
* @link http://reasonstousegenesis.com/last-updated-date/
*/
add_filter( 'genesis_post_info', 'rtug_last_updated_date_before_after' );
@reasonstousegenesis
reasonstousegenesis / functions.php
Last active August 29, 2015 14:20
Set a fallback featured image with Genesis
<?php
// Paste the code BELOW this line into your child theme functions.
/**
* Set a fallback featured image with Genesis
*
* @author Reasons to Use Genesis
* @link http://reasonstousegenesis.com/default-featured-image/
*/
add_filter( 'genesis_get_image_default_args', 'rtug_fallback_featured_image' );
@reasonstousegenesis
reasonstousegenesis / functions.php
Last active August 29, 2015 14:20
Set a fallback featured image based on args
<?php
// Paste the code BELOW this line into your child theme functions.
/**
* Set a fallback featured image based on args
*
* @author Reasons to Use Genesis
* @link http://reasonstousegenesis.com/default-featured-image/
*/
add_filter( 'genesis_get_image_default_args', 'rtug_fallback_featured_image_args', 10, 2 );
@reasonstousegenesis
reasonstousegenesis / functions.php
Last active August 29, 2015 14:20
Set a fallback featured image based on category
<?php
// Paste the code BELOW this line into your child theme functions.
/**
* Set a fallback featured image based on category
*
* @author Reasons to Use Genesis
* @link http://reasonstousegenesis.com/default-featured-image/
*/
add_filter( 'genesis_get_image_default_args', 'rtug_fallback_featured_image_category' );
<?php
// Plugin Name: My Custom Plugin for WordPress + Genesis
add_filter( 'genesis_search_text', 'rtug_search_input_text' );
function rtug_search_input_text( $text ) {
return 'Search my website';
}
<?php
// Plugin Name: My Custom Plugin for WordPress + Genesis
genesis_standard_loop();
@reasonstousegenesis
reasonstousegenesis / plugin.php
Last active August 29, 2015 14:20
How to use Genesis functions in a plugin
<?php
//* Plugin Name: My Custom Plugin for WordPress + Genesis
/**
* How to use Genesis functions in a plugin
*
* @author Reasons to Use Genesis
* @link http://reasonstousegenesis.com/genesis-functions-plugin/
*/
add_action( 'genesis_setup', 'rtug_loop' );