Skip to content

Instantly share code, notes, and snippets.

View j-gardner's full-sized avatar

John Gardner j-gardner

View GitHub Profile
@j-gardner
j-gardner / functions.php
Last active August 16, 2016 15:39
Add Category Support to FAQ Post Type
<?php
// Add the following to your theme's functions.php file
add_action( 'plugins_loaded', 'add_categories_to_cpt', 15 );
function add_categories_to_cpt(){
register_taxonomy_for_object_type( 'category', 'faq');
// 'faq' can be changed to any registered post type
}
<?php
$cpt = new Arconix_CPT_Register();
$cpt->add( 'books' );
$tax = new Arconix_Taxonomy_Register();
$tax->add( 'genres', 'books' );
@j-gardner
j-gardner / gist:ce417c886a29163018edada999f9c12c
Last active June 26, 2016 23:50
Change the FontAwesome version (add to your theme's functions.php file)
<?php // DO NOT include the opening php tag
// Replace 4.6.0 with whatever version you'd like
add_filter( 'arconix_fontawesome_version', '4.6.0' );
@j-gardner
j-gardner / gist:6529691
Last active December 22, 2015 20:59
Add Comment support to the Portfolio CPT
<?php // DO NOT include the opening php tag
add_action( 'init', 'arconix_post_type_supports' );
function arconix_post_type_supports() {
add_post_type_support( 'portfolio', 'comments' );
}
@j-gardner
j-gardner / gist:6518347
Last active December 22, 2015 19:19
Set a custom rewrite slug for Arconix Portfolio
<?php // DO NOT include the opening php tag
add_filter( 'arconix_portfolio_defaults', 'my_custom_rewrite' );
function my_custom_rewrite( $defaults ) {
$defaults['post_type']['args']['has_archive'] = true;
$defaults['post_type']['args']['rewrite']['slug'] = 'CUSTOMREWRITE';
// change CUSTOMREWRITE to your desired slug -- http://yourdomain.com/CUSTOMREWRITE
return $defaults;
}
@j-gardner
j-gardner / gist:6513811
Last active December 22, 2015 18:39
Example 5-column shortcode
## 2 columns - 40% / 60% ##
[two-fifths]
Content
[/two-fifths]
[three-fifths last]
Content
[/three-fifths]
## 3 columns - 20% / 60% / 20% ##
[one-fifth]
@j-gardner
j-gardner / gist:6513747
Last active December 22, 2015 18:29
Example 4-column shortcode
## 2 columns - 25% / 75% ##
[one-fourth]
Content
[/one-fourth]
[three-fourths last]
Content
[/three-fourths]
## 3 columns - 25% / 25% / 50% ##
[one-fourth]
@j-gardner
j-gardner / gist:6513703
Last active December 22, 2015 18:29
Example 3-column shortcode
## 2 columns - 33% / 66% ##
[one-third]
This is the column 1 content
[/one-third]
[two-thirds last]
This is the column 2 content
[/two-thirds]
## 3 columns - 33% ea ##
[one-third]
@j-gardner
j-gardner / gist:6513660
Last active December 22, 2015 18:29
Example 2 column shortcode
## 2 columns - 50% ea ##
[one-half]
This is the left column content
[/one-half]
[one-half last]
This is the right column content
[/one-half]
@j-gardner
j-gardner / gist:6510690
Last active December 22, 2015 18:09
Example list shortcode
[list icon="fa-send" icon_color="green"]
-= Use the unordered list button on the editor toolbar to create the actual list items =-
* Item 1
* Item 2
* Item 3
[/list]