Skip to content

Instantly share code, notes, and snippets.

View simbasounds's full-sized avatar

Simon Barnett simbasounds

View GitHub Profile
@simbasounds
simbasounds / register portolio cpt functions.php
Last active January 10, 2016 14:49
Code to be added to Genesis functions.php to have a portfolio custom post type with archive support
<?php
/* Do not remove this line. Add your functions below. */
// Register Portfolio Items Custom Post Type
function register_portfolio() {
$labels = array(
'name' => _x( 'Portfolio Items', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Portfolio Item', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Portfolio Items', 'text_domain' ),
@simbasounds
simbasounds / Genesis archive-portfolio.php
Last active January 10, 2016 14:51
A portfolio custom post type archive with title, excerpt and thumbnail hooking into Genesis Framework
<?php
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
add_action( 'genesis_after_entry_content', 'add_entry_header' );
function add_entry_header() {
<?php
add_action('genesis_after_header','portfolio_title');
function portfolio_title() { ?>
<div class="portfolio-title">
<div class="wrap">
<h1 class="entry-title" itemprop="headline">
<span class="portfolio-headline">Portfolio » </span>
<?php the_title(); ?>
</h1>
@simbasounds
simbasounds / 0_reuse_code.js
Created April 8, 2014 21:32
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console