Skip to content

Instantly share code, notes, and snippets.

@markjaquith
markjaquith / fix-twitter-https.php
Created January 21, 2014 02:14
Fix Twitter embeds in WordPress < 3.8.1
<?php
add_filter( 'oembed_providers', 'oembed_fix_twitter', 10, 1 );
function oembed_fix_twitter( $providers ) {
$providers[ '#https?://(www\.)?twitter\.com/.+?/status(es)?/.*#i' ] = array( 'https://api.twitter.com/1/statuses/oembed.{format}', true );
return $providers;
}
//Enqueue the Dashicons script
add_action( 'wp_enqueue_scripts', 'amethyst_enqueue_dashicons' );
function amethyst_enqueue_dashicons() {
wp_enqueue_style( 'amethyst-dashicons-style', get_stylesheet_directory_uri(), array('dashicons'), '1.0' );
}
// Optional Custom entry meta in entry header - remove "by""
add_filter( 'genesis_post_info', 'amethyst_filter_post_info' );
function amethyst_filter_post_info($post_info) {
$post_info = '[post_date] [post_author_posts_link] [post_comments] [post_edit]';
@billerickson
billerickson / template-gallery.php
Last active January 10, 2017 09:12
Pagination in a custom query
<?php
/**
* Blog Intro
*
*/
function be_blog_intro() {
$content = get_post( get_option( 'page_for_posts' ) )->post_content;
if( $content )
echo '<div class="blog-intro">' . wpautop( $content ) . '</div>';
@bradpotter
bradpotter / functions.php
Last active July 18, 2017 08:26
How to Add “Top” and “Footer” Menus to Genesis
// Register and Hook Top Navigation Menu
add_action('genesis_before_header', 'sample_before_header_menu', 10);
function sample_before_header_menu() {
register_nav_menu( 'top', 'Top Navigation Menu' );
genesis_nav_menu( array(
'theme_location' => 'top',
'menu_class' => 'menu genesis-nav-menu menu-top',
) );
@pasadamedia
pasadamedia / gist:c18d5cd135ddb5085ed0
Last active March 23, 2018 19:46
Display WooThemes Sensei comments and messages in a Genesis framework child theme. Insert in your child theme's functions.php file.
/**
* Remove Sensei comments output and replace with comments done the Genesis way.
*
* @notes Extends the WooThemes_Sensei_Frontend class.
*
*/
if (class_exists('WooThemes_Sensei_Frontend')) {
remove_action( 'sensei_comments', array( $woothemes_sensei->frontend, 'sensei_output_comments' ), 10 );
add_action( 'sensei_comments', array( 'WooThemes_Sensei_Frontend_Comments', 'pasada_sensei_output_comments' ), 10 );
@robneu
robneu / genesis-nav-space-fix.css
Last active May 21, 2018 20:45
Remove unwated space from nav elements on Genesis themes.
/**
* The Default Genesis styles have a bug which causes extra unwanted
* space to display in the nav menu bar elements. This will remove the
* extra space cross-browser. The reason for the strange .001px font size
* is due to a bug on older Andorid devices.
*
* Note: I've used the default Genesis styles here as an example. The only
* actual change is the font-size rule on both selectors.
*
* Reference link: http://css-tricks.com/fighting-the-space-between-inline-block-elements/
@ozzyrod
ozzyrod / responsive-menu-css.css
Last active April 23, 2019 05:54
Creates a mobile responsive menu in a Genesis child theme with support for collapsible sub menus.
/* Responsive Navigation
---------------------------------------------------------------------------------------------------- */
/* Standard Navigation
--------------------------------------------- */
nav {
clear: both;
}
@DustonMcGroarty
DustonMcGroarty / genesis-sales-page.php
Last active July 14, 2019 20:46
Genesis Sales Page Template
<?php
/*
Template Name: Sales Page
*/
//* Add custom body class to the head
add_filter( 'body_class', 'dm_add_body_class' );
function dm_add_body_class( $classes ) {
$classes[] = 'dm-sales';
@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.