Skip to content

Instantly share code, notes, and snippets.

View JiveDig's full-sized avatar

Mike Hemberger JiveDig

View GitHub Profile
@JiveDig
JiveDig / add_structural_wraps.php
Created May 9, 2013 19:30
Add support for structural wraps
<?php
//* Add support for structural wraps
add_theme_support( 'genesis-structural-wraps', array(
'header',
'nav',
'subnav',
'inner',
'footer-widgets',
'footer'
@JiveDig
JiveDig / Child theme start
Last active December 17, 2015 04:19
The beginning code for a child theme functions.php file
<?php
/**
* Functions
* @package The Stiz Media
* @author JiveDig <mike@thestizmedia.com>
* @copyright Copyright (c) 2013, The Stiz
*/
// Start the engine
require_once( get_template_directory() . '/lib/init.php' );
@JiveDig
JiveDig / EDD Rename 'downloads'.php
Created May 9, 2013 19:41
Easy Digital Downloads (EDD) - Rename downloads title to something else. Custom post type remains 'download'.
// Change labels to "Tracks"
add_filter('edd_download_labels', 'set_download_labels');
function set_download_labels($labels) {
$labels = array(
'name' => _x('Tracks', 'post type general name', 'your-domain'),
'singular_name' => _x('Track', 'post type singular name', 'your-domain'),
'add_new' => __('Add New', 'your-domain'),
'add_new_item' => __('Add New Track', 'your-domain'),
'edit_item' => __('Edit Track', 'your-domain'),
'new_item' => __('New Track', 'your-domain'),
@JiveDig
JiveDig / Register custom post type
Last active December 17, 2015 04:19
Register custom post type, with Videos as the example
<?php
// Register 'Videos' Post Type
if ( ! function_exists('jivedig_videos_post_type') ) {
function jivedig_videos_post_type() {
$labels = array(
'name' => _x( 'Videos', 'executive' ),
'singular_name' => _x( 'Video', 'executive' ),
'menu_name' => __( 'Videos', 'executive' ),
'parent_item_colon' => __( 'Parent Video:', 'executive' ),
@JiveDig
JiveDig / Create new plugin
Last active December 17, 2015 04:19
Create new plugin in WordPress.
<?php
/*
Plugin Name: CUSTOM - Website Title
Plugin URI: http://thestizmedia.com
Description: All custom funtionality for www.Website_Title_Here.com
Version: 1.0
Author: JiveDig
Author URI: http://thestizmedia.com
Copyright 2013 JiveDig (mike@thestizmedia.com)
*/
@JiveDig
JiveDig / Register new Category taxonomy
Created May 9, 2013 20:07
Register new taxonomy, like Categories
// ------------------------------ Video Categories
if ( ! function_exists('jivedig_video_category_taxonomy') ) {
// Register Custom Taxonomy
function jivedig_video_category_taxonomy() {
$labels = array(
'name' => 'Video Categories',
'singular_name' => 'Video Category',
'menu_name' => 'Video Categories',
'all_items' => 'All Video Categories',
@JiveDig
JiveDig / Register new Tag taxonomy
Created May 9, 2013 20:08
Register new taxonomy, like Tags
// ------------------------------ Video Tags
if ( ! function_exists('jivedig_video_tag_taxonomy') ) {
// Register Custom Taxonomy
function jivedig_video_tag_taxonomy() {
$labels = array(
'name' => 'Video Tags',
'singular_name' => 'Video Tag',
'menu_name' => 'Video Tags',
@JiveDig
JiveDig / Genesis Simple Sidebars in templates
Created May 9, 2013 21:33
Add Genesis Simple Sidebar to a template. Good for archive.php, archive-custom-post-type.php, single.php, etc...
// Use 'Portfolio" sidebar - via Genesis Simple Sidebars plugin
add_action( 'get_header', 'thestiz_portfolio_sidebar_init', 20 );
function thestiz_code_sidebar_init() {
remove_action('genesis_sidebar', 'ss_do_sidebar');
add_action( 'genesis_sidebar', 'thestiz_do_portfolio_sidebar' );
}
function thestiz_do_portfolio_sidebar() {
dynamic_sidebar( 'portfolio' );
}
@JiveDig
JiveDig / Remove site title and site description.php
Created May 10, 2013 16:53
Remove site title and site description
// Remove the site title
remove_action( 'genesis_site_title', 'genesis_seo_site_title' );
// Remove the site description
remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
@JiveDig
JiveDig / Remove titles from pages only
Last active December 17, 2015 05:09
Remove titles from pages only
// Remove titles from pages only
add_action('get_header', 'child_remove_page_titles');
function child_remove_page_titles() {
$pages=array();
if (is_page($pages)) {
remove_action('genesis_entry_header', 'genesis_do_post_title');
}
}