Skip to content

Instantly share code, notes, and snippets.

View wpspeak's full-sized avatar

WPSpeak wpspeak

View GitHub Profile
<?php
/**
* Simple Grid helper functions.
*
* @package SimpleGrid
* @subpackage Genesis
* @copyright Copyright (c) 2014, Flagship, LLC
* @license GPL-2.0+
* @since 1.0.0
*/
@bradpotter
bradpotter / responsive-menu.js
Last active January 4, 2016 11:09
Combine Primary and Secondary Menu into one Responsive Menu
/* Make sure your Menus are named Primary Navigation and Secondary Navigation in Appearance > Menus */
(function( window, $, undefined ) {
'use strict';
$('.nav-primary').before('<button class="menu-toggle" role="button" aria-pressed="false"></button>'); // Add toggles to menus
$('nav .sub-menu').before('<button class="sub-menu-toggle" role="button" aria-pressed="false"></button>'); // Add toggles to sub menus
// Show/hide the navigation
$('.menu-toggle, .sub-menu-toggle').click(function() {
@robneu
robneu / podcast-air-date.php
Last active December 29, 2015 12:39
Display some information about a podcast's air date using Genesis.
<?php
add_action( 'genesis_before_content', 'wpbacon_podcast_date_info' );
/**
* Displays information about the podcast's air date including the date, time,
* and whether or not it's already aired.
*
* @since 2.0.0
*/
function wpbacon_podcast_date_info() {
@GaryJones
GaryJones / readme.md
Last active July 14, 2019 20:46
Custom Featured Post Widget plugin: Skeleton for amending the output of the Genesis Featured Post widget.
@studiopress
studiopress / functions.php
Last active March 22, 2017 05:41
Sticky menu.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Enqueue sticky menu script
add_action( 'wp_enqueue_scripts', 'sp_enqueue_script' );
function sp_enqueue_script() {
wp_enqueue_script( 'sample-sticky-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/sticky-menu.js', array( 'jquery' ), '1.0.0' );
}
//* Reposition the secondary navigation menu
<?php
/** Add Project Information After Content */
add_action ( 'genesis_sidebar', 'mmi_sing_project_side' );
function mmi_sing_project_side() {
echo '<div class="mmi-sidebar">';
echo '<section class="widget">';
echo '<h4 class="widgettitle">Participate In This Project</h4>';
$participants = get_post_meta(get_the_ID(), 'participants_needed', false);
@jgalea
jgalea / genesis-byline.php
Created August 14, 2013 14:30
Use the last updated date rather than publish date on posts.
<?php
add_filter( 'genesis_post_info', 'custom_post_info' );
function custom_post_info( $post_info ) {
$u_time = get_the_time( 'U' );
$u_modified_time = get_the_modified_time( 'U' );
if ( $u_modified_time >= $u_time + 86400 ) {
$post_date = get_the_modified_time( 'F jS, Y' );
}
@bradyvercher
bradyvercher / audiotheme-genesis.css
Last active March 22, 2017 08:59
Custom CSS for integrating AudioTheme with Genesis 2.0
/* General */
.archive .audiotheme {
margin-bottom: 40px;
padding: 40px 40px 20px 40px;
background: #fff;
}
.audiotheme .audiotheme-archive-title {
margin-bottom: 1.6rem;
@longjasonm
longjasonm / functions.php
Last active November 6, 2019 00:40
How to set up a 4-column footer in the Genesis framework. I've only seen code about 3-column setups, but I need 4 for a design I'm working on. Here's my code.
<?php
//* Do NOT include the opening php tag
// Add support for 4-column footer widgets
add_theme_support( 'genesis-footer-widgets', 4 );
<?php
//* Do NOT include this comment or the opening php tag above
//* Wrap first word of widget title into a span tag
add_filter ( 'widget_title', 'b3m_add_span_widgets' );
function b3m_add_span_widgets( $old_title ) {
$title = explode( " ", $old_title, 2 );
if ( isset( $title[0] ) && isset( $title[1] ) ) {