Skip to content

Instantly share code, notes, and snippets.

View bizzthemes's full-sized avatar

BizzThemes bizzthemes

View GitHub Profile
@bizzthemes
bizzthemes / cpt-layout-support.php
Last active January 2, 2016 07:39
How to add layout settings to custom post type.
<?php
//* Do NOT include the opening php tag, only copy the code below
//* Register custom post type example
add_action( 'init', 'portfolio_post_type' );
function portfolio_post_type() {
register_post_type( 'portfolio', array(
'labels' => array(
'name' => __( 'Portfolio', 'bizznis-child' ),
'singular_name' => __( 'Portfolio', 'bizznis-child' ),
@bizzthemes
bizzthemes / page-landing.php
Created January 6, 2014 15:30
Create a custom template in a child theme: Landing page
<?php
//* Template Name: Landing
//* Force full width content layout
add_filter( 'bizznis_pre_get_option_site_layout', 'bizznis_return_landing_layout' );
function bizznis_return_landing_layout() {
return 'full-width-content';
}
//* Remove header and footer for this page template
@bizzthemes
bizzthemes / style.css
Last active January 2, 2016 19:19
Child themes style.css header structure
/*
Theme Name: Bizznis Child
Theme URI: https://github.com/bizzthemes/bizznis-child/
Description: This is child theme example that was created to show developers how to make their own child themes for Bizznis.
License: GPL version 3
License URI: http://gplv3.fsf.org/
Version: 1.0
Author: BizzThemes
Author URI: http://bizzthemes.com/
Tags: light, gray, white, one-column, two-columns, three-columns, right-sidebar, left-sidebar, responsive-layout, fluid-layout, custom-menu, featured-images, full-width-template, microformats, rtl-language-support, sticky-post, theme-options, translation-ready
@bizzthemes
bizzthemes / functions.php
Last active January 2, 2016 19:29
Child themes functions.php header
<?php
//* This file calls the init.php file inside parent Bizznis theme (do not remove)
load_template( get_template_directory() . '/lib/init.php' );
//* Child theme (do not remove)
define( 'CHILD_THEME_NAME', __( 'Bizznis Child Theme', 'bizznis-child' ) );
define( 'CHILD_THEME_URL', 'https://github.com/bizzthemes/bizznis-child/' );
define( 'CHILD_THEME_VERSION', '1.0' );
//* Set Localization (do not remove)
@bizzthemes
bizzthemes / allowed-tags.php
Last active January 2, 2016 20:49
Formatting allowed tags filter
<?php
//* Do NOT include the opening php tag, only copy the code below
array(
'p' => array( 'align' => array(), 'class' => array(), 'style' => array() ),
'span' => array( 'align' => array(), 'class' => array(), 'style' => array() ),
'div' => array( 'align' => array(), 'class' => array(), 'style' => array() ),
'a' => array( 'href' => array(), 'title' => array() ),
'b' => array(),
'strong' => array(),
@bizzthemes
bizzthemes / bizznis.html
Created January 11, 2014 18:27
HTML5 structure overview of Bizznis
<!DOCTYPE html>
<html lang="en-US">
<!-- DOCUMENT HEAD -->
<head>
<title></title>
<meta />
<link />
<!-- HEADER SCRIPTS -->
@bizzthemes
bizzthemes / register-widget-area.php
Last active January 3, 2016 01:39
Register sidebar before each single post entry
<?php
//* Do NOT include the opening php tag, only copy the code below
//* Register widget area before each single post entry
bizznis_register_widget_area( array(
'id' => 'before-entry',
'name' => __( 'Before Entry', 'bizznis-child' ),
'description' => __( 'This is a widget area that can be placed before the post entry', 'bizznis-child' ),
) );
@bizzthemes
bizzthemes / display-widget-area.php
Created January 12, 2014 21:22
Display sidebar before each single post entry
<?php
//* Do NOT include the opening php tag, only copy the code below
//* Display sidebar before each single post entry
add_action( 'bizznis_before_entry', 'custom_after_entry_widget' );
function custom_after_entry_widget() {
if ( is_singular( 'post' ) ) {
# function that returns sidebar widgets for the registered area
bizznis_widget_area( 'before-entry', array(
'before' => '<div class="before-entry widget-area">',
@bizzthemes
bizzthemes / breadcrumb-args.php
Last active January 3, 2016 05:19
Modify the Breadcrumbs
<?php
//* Do NOT include the opening php tag, only copy the code below
//* Modify breadcrumb arguments.
add_filter( 'bizznis_breadcrumb_args', 'custom_breadcrumb_args' );
function custom_breadcrumb_args( $args ) {
$args['home'] = 'Home';
$args['sep'] = ' / ';
$args['list_sep'] = ', ';
$args['prefix'] = '<div class="breadcrumb">';
@bizzthemes
bizzthemes / add-image-size.php
Created January 24, 2014 16:13
Modify images
<?php
//* Do NOT include the opening php tag, only copy the code below
//* Add new featured image sizes
add_image_size( 'home-featured', 350, 300, true );
add_image_size( 'footer-widget', 255, 200, true );