Skip to content

Instantly share code, notes, and snippets.

@jamiemitchell
jamiemitchell / home.php
Last active December 11, 2015 14:59
Custom home page for Genesis Framework
<?php
add_action( 'genesis_before_loop', 'childtheme_welcome_widget' );
function childtheme_welcome_widget() {
dynamic_sidebar( 'Home Welcome' );
}
@jamiemitchell
jamiemitchell / category-custom.php
Last active December 11, 2015 15:08
Custom category page for Genesis Framework
<?php
/* Add the featured image after post title
------------------------------------------------------------ */
add_action( 'genesis_before_post_title', 'jm_portfolio_grid' );
function jm_portfolio_grid() {
if ( has_post_thumbnail() ){
echo '<a class="alignleft" href="' . get_permalink() .'" title="' . the_title_attribute( 'echo=0' ) . '">';
echo get_the_post_thumbnail($thumbnail->ID, 'thumbnail', array('class' => 'alignleft'));
@jamiemitchell
jamiemitchell / functions.php
Last active December 11, 2015 16:38
Add next/prev to single post in Genesis Framework.
<?php
/* Add Previous & Next Links in Genesis Single Post Page
------------------------------------------------------------ */
add_action('genesis_after_post_content', 'genesis_post_navigation');
function genesis_post_navigation() {
if ( is_single ( ) ) { ?>
<div id="prev-next">
<?php
/**
* List Posts tagged 'thesis-tip'
*
*/
function be_display_thesis_tip() {
$args = array(
'tag' => 'thesis-tip',
'posts_per_page' => '-1',
@jamiemitchell
jamiemitchell / functions.php
Created January 25, 2013 12:37
Remove Wordpress Default Gallery css. Very Handy !
<?php
/* Removes Wordpress Default Gallery css
------------------------------------------------------------ */
add_filter( 'use_default_gallery_style', '__return_false' );
@jamiemitchell
jamiemitchell / functions.php
Created January 29, 2013 02:00
Move image above post title in Genesis Framework.
<?php
/* Move image above post title
------------------------------------------------------------ */
remove_action( 'genesis_post_content', 'genesis_do_post_image' );
add_action( 'genesis_before_post_title', 'genesis_do_post_image' );
@jamiemitchell
jamiemitchell / functions.php
Created January 29, 2013 02:09
Add post image above post title in Genesis Framework
<?php
/* Add image above post title
------------------------------------------------------------ */
add_action( 'genesis_before_post', 'jm_post_image' );
function jm_post_image() {
if ( is_page() ) return;
<?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;
}