Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* List Posts tagged 'thesis-tip'
*
*/
function be_display_thesis_tip() {
$args = array(
'tag' => 'thesis-tip',
'posts_per_page' => '-1',
<?php
/**
* Don't show Events category on homepage
* Category 5 = Events category, so we use cat=-5
*
* @link http://www.billerickson.net/thesis-wordpress-remove-category-homepage/
* @author Bill Erickson
* @param object $query
*/
<script type='text/javascript' src='http://www.briangardner.com/js/backstretch.js'></script>
<script>
jQuery(document).ready(function($) {
$("body").backstretch(["http://www.briangardner.com/wp-content/uploads/bg.jpg"],{duration:3000,fade:750});
});
</script>
@jamiemitchell
jamiemitchell / functions.php
Created April 7, 2013 07:24 — forked from eugenoprea/functions.php
Add custom post class
// Add custom post class to posts in the "Featured" category
add_filter('post_class', 'eo_custom_post_class');
function eo_custom_post_class($classes)
{
$new_class = 'featured-post';
if (in_category('Featured'))
$classes[] = esc_attr(sanitize_html_class($new_class));
return $classes;
}
@jamiemitchell
jamiemitchell / functions.php
Last active December 16, 2015 01:59 — forked from GaryJones/functions.php
Genesis Grid Loop Advanced
<?php
/**
* Possibly amend the loop.
*
* Specify the conditions under which the grid loop should be used.
*
* @author Bill Erickson
* @author Gary Jones
* @link http://code.garyjones.co.uk/genesis-grid-loop-advanced/
<?php
/**
* Template Name: Testimonial Archives
* Description: Used as a page template to show page contents, followed by a loop through a CPT archive
*/
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop
add_action( 'genesis_loop', 'custom_do_loop' ); // Add custom loop
<?php
/**
* Don't show Events category on homepage
* Category 5 = Events category, so we use cat=-5
*
* @link http://www.billerickson.net/thesis-wordpress-remove-category-homepage/
* @author Bill Erickson
* @param object $query
*/
<?php
// Enqueue sticky menu script
add_action( 'wp_enqueue_scripts', 'custom_enqueue_script' );
function custom_enqueue_script() {
wp_enqueue_script( 'sticky-menu', get_stylesheet_directory_uri() . '/js/sticky-menu.js', array( 'jquery' ), '', true );
}
// Reposition the secondary navigation menu
remove_action( 'genesis_after_header', 'genesis_do_subnav' );
<?php
add_action( 'genesis_before_loop', 'child_maybe_do_grid_loop' );
function child_maybe_do_grid_loop() {
// Amend this conditional to pick where this grid looping occurs
if ( is_page('2') ) {
remove_action('genesis_before_post_content', 'genesis_post_info');