Skip to content

Instantly share code, notes, and snippets.

View GaryJones's full-sized avatar

Gary Jones GaryJones

View GitHub Profile
@GaryJones
GaryJones / gist:daaa55c4c4b380ecfb70
Created January 22, 2016 10:08 — forked from srikat/gist:8350989
Conditional code for different days of a week
<?php
$dates = array("Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
);
<?php
add_action( 'genesis_entry_content', 'kat_grid_content', 9 );
/**
* Change the number of words in excerpt if in the grid loop and customize READ MORE, add accessibility.
*/
function kat_grid_content() {
// Make sure we're in the grid loop.
if ( ! apply_filters( 'is_genesis_grid_loop', false ) ) {
return;
<?php
/**
* Blog Intro
*/
add_action( 'genesis_before_loop', 'rgc_blog_intro' );
/**
* Add title and content before blog archive loop.
*
* @author Robin Cornett
<?php
/**
* Get post image.
*/
function wds_get_post_image( $size = 'thumbnail' ) {
// If featured image is present, use that
if ( has_post_thumbnail() ) {
return get_the_post_thumbnail( $size );
<?php
// Add a post signature for multiple authors.
// All signature divs will have a class of .signature for common styling
// then .signature-cat as the default and .signature-tracey for the guest
// as class modifiers (different background image, or background position
// if using sprites etc.)
// If it's not a single entry of any post type, return.
if ( is_single() ) {
return;
<?php
/* File level DocBlock here - includes/class-remove-h1-format.php */
/* Class level DocBlock here */
class Remove_H1_Format {
/*
* Modify TinyMCE editor to remove H1.
*/
public function remove( $init ) {
// GJ: No need for the filter - if they don't want it running, deactivate the plugin.
@GaryJones
GaryJones / nav-extras.php
Last active April 30, 2020 15:14 — forked from studiopress/nav-extras.php
Add Genesis Primary Nav Extras features in manually.
<?php
// Don't include the above <?php when copying
add_filter( 'wp_nav_menu_items', 'prefix_primary_nav_extras', 10, 2 );
/**
* Filter menu items, appending either a search form or today's date.
*
* @param string $menu HTML string of list items.
* @param stdClass $args Menu arguments.
filter:
excluded_paths:
- 'vendor/*'
- 'tests/*'
- 'src/wp-admin/includes/class-ftp*'
- src/wp-admin/includes/class-pclzip.php
- 'src/wp-content/*'
- 'src/wp-includes/ID3/*'
- 'src/wp-includes/SimplePie/*'
- 'src/wp-includes/Text/*'
/**
* {{singular}} Custom Post Type.
*
* @package {{plural}}
* @author Your Name <email@example.com>
* @license GPL-2.0+
* @link http://www.blazersix.com/wordpress-code-generators/
*
* @todo Remove unused code and update where needed.
*