Skip to content

Instantly share code, notes, and snippets.

View jameskoster's full-sized avatar
🍕

James Koster jameskoster

🍕
View GitHub Profile
@jameskoster
jameskoster / functions.php
Created February 18, 2014 10:50
Projects - Add a custom field to the project details meta box
function new_projects_fields( $fields ) {
$fields['location'] = array(
'name' => __( 'Location', 'projects' ),
'description' => __( 'Enter a location for this project.', 'projects' ),
'type' => 'text',
'default' => '',
'section' => 'info'
);
return $fields;
@jameskoster
jameskoster / functions.php
Created February 18, 2014 11:00
Projects - Display a custom meta field on the projects archive
function display_new_projects_fields() {
global $post;
$location = esc_attr( get_post_meta( $post->ID, '_location', true ) );
echo '<p>' . __( 'Location: ', 'projects' ) . $location . '</p>';
}
add_action( 'projects_after_loop_item', 'display_new_projects_fields', 10 );
@jameskoster
jameskoster / functions.php
Created February 24, 2014 09:49
Stitched - Add a slider to the homepage
add_action( 'woo_homepage', 'woo_display_wooslider', 1 );
@jameskoster
jameskoster / functions.php
Created February 24, 2014 09:52
Sttiched - Change number of features displayed on the homepage
add_filter( 'woo_template_features_limit', 'jk_change_features_homepage' );
function jk_change_features_homepage( $features_limit ) {
if ( is_home() ) {
$features_limit = 4; // Display 4 features
}
return $features_limit;
}
@jameskoster
jameskoster / functions.php
Last active August 29, 2015 13:56
Sttiched - change the number of team members displayed on the homepage
add_filter( 'woo_template_our_team_limit', 'jk_change_our_team_homepage' );
function jk_change_our_team_homepage( $team_limit ) {
if ( is_home() ) {
$team_limit = 8; // Display 8 team members
}
return $team_limit;
}
@jameskoster
jameskoster / functions.php
Created February 24, 2014 09:54
Stitched - Disable introduction gravatar
add_filter( 'woo_header_gravatar', '__return_false' );
@jameskoster
jameskoster / functions.php
Created February 24, 2014 09:56
Sttiched - Change gravatar email in introduction
add_filter( 'woo_header_gravatar_email', 'jk_change_intro_grav_email' );
function jk_change_intro_grav_email( $email ) {
$email = email@email.com;
return $email;
}
@jameskoster
jameskoster / functions.php
Created February 24, 2014 09:57
Stitched - Change introduction text
add_filter( 'stitched_intro_message', 'jk_custom_intro_message' );
function jk_custom_intro_message( $intro ) {
$intro = 'My custom introductory text';
return $intro;
}
@jameskoster
jameskoster / functions.php
Created February 24, 2014 09:58
Stitched - Disable the homepage introduction section
remove_action( 'woo_homepage', 'woo_display_introduction', 5 );
@jameskoster
jameskoster / functions.php
Created February 26, 2014 15:37
Stitched - Disable sections on the business template
add_filter( 'woo_business_slider', '__return_false' ); // Disable the slider
add_filter( 'woo_business_features', '__return_false' ); // Disable Features display
add_filter( 'woo_business_testimonials', '__return_false' ); // Disable Testimonials display
add_filter( 'woo_business_blog', '__return_false' ); // Disable blog section