Skip to content

Instantly share code, notes, and snippets.

@robneu
robneu / genesis-social-sharing-buttons.php
Last active December 18, 2015 03:29
Add po.st social sharing buttons to a Genesis child theme without a plugin
<?php
/**
* Adds po.st social sharing buttons
* to single posts and pages.
* Create an account at http://po.st
* to get a publisher key.
*
* @author Robert Neu
* @link http://youneedfat.com
* @copyright Copyright (c) 2013, FAT Media, LLC
@robneu
robneu / auto-genesis-cache-busting.php
Last active December 17, 2018 10:12
Automatic cache busting in the Genesis Framework based on the last time the file was modified.
<?php
// Remove the default Genesis child theme CSS
remove_action( 'genesis_meta', 'genesis_load_stylesheet' );
add_action( 'wp_enqueue_scripts', 'prefix_load_stylesheet' );
/**
* Get the time the theme's CSS was last modified
* and use it to bust the cache by appending
* it to the CSS output.
*
* @author FAT Media
<?php
/**
* Change the post order for listings
*
* @author Carrie Dils
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @reference http://codex.wordpress.org/Class_Reference/WP_Query
*
*/
@robneu
robneu / display-repeatable-group-cmb.php
Last active December 18, 2015 21:19
Get the data out of a repeatable group using the Custom Meta Boxes script from Humanmade
<?php
/**
* Display a repeatable group using the humanmade
* Custom Meta Boxes script
*
* @author FAT Media <http://youneedfat.com>
* @copyright Copyright (c) 2013, FAT Media, LLC
* @license GPL-2.0+
*/
// Get all the post's custom metadata
@robneu
robneu / mp6-admin.php
Last active December 18, 2015 22:19
Prevent MP6 Admin Styles from Loading on the Front End
<?php
/**
* Prevent unnecessary styles from
* loading on the front end
*
* @author FAT Media <http://youneedfat.com>
* @copyright Copyright (c) 2013, FAT Media, LLC
* @license GPL-2.0+
*/
@robneu
robneu / gist:5937747
Last active December 19, 2015 10:08 — forked from cdils/gist:5430275
<?php
/************************************************
* This is not currently working.
************************************************/
add_action( 'pre_get_posts', 'cd_listing_sort_order' );
/**
* Change the post order for listings
*
* @author Carrie Dils
* @link http://www.billerickson.net/customize-the-wordpress-query/
@robneu
robneu / reverse-post-order.php
Last active December 19, 2015 10:29
Reverse the post order for the Genesis Framework
<?php
add_action( 'pre_get_posts', 'prefix_reverse_post_order' );
/**
* Reverse Post Order for Post Archives
* on the Genesis Framework
*
* @author FAT Media
* @link http://youneedfat.com/reverse-post-order-genesis-framework/
* @param object $query data
*
@robneu
robneu / reverse-post-order-blog-template.php
Last active December 19, 2015 10:29
Reverse the post order on the page_blog.php template on the Genesis Framework.
<?php
add_filter( 'genesis_custom_loop_args', 'prefix_reverse_blog_template_order' );
/**
* Reverse Post Order on the page_blog.php
* template on the Genesis Framework
*
* @author FAT Media
* @link http://youneedfat.com/reverse-post-order-genesis-framework/
*
*/
@robneu
robneu / fixed-header-body.css
Last active December 19, 2015 10:39
Add padding to the body element equal to the height of your fixed header element.
/*
Body Element
---------------------------------------------------------------------------------------------------- */
/* This Should Be Equal to the Height of your
* fixed header bar.
--------------------------------------------- */
body {
padding-top: 81px;
padding-top: 8.1rem; /* Only Add this in Genesis 2.0 */
@robneu
robneu / fixed-header-wordpress.css
Last active March 21, 2017 10:47
Assign the fixed position to your header and set the width to 100%. You'll also need to set a high z-index to make sure your header doesn't get overlapped by embeded objects and other similar items. The second part will make your site look normal when you're logged in and the admin bar is showing.
/*
Site Header
---------------------------------------------------------------------------------------------------- */
/* This is where the magic happens. You need
* to assign a fixed position in order for
* everything else to work correctly.
--------------------------------------------- */
.site-header {
position: fixed;
top: 0;