Skip to content

Instantly share code, notes, and snippets.

View jameskoster's full-sized avatar
🍕

James Koster jameskoster

🍕
View GitHub Profile
@jameskoster
jameskoster / content-team-member.php
Last active August 29, 2015 13:58
Our Team - A sample team member content template file
<?php
/**
* A template to display team member content
*/
global $post;
?>
<?php
$team_member_email = esc_attr( get_post_meta( $post->ID, '_gravatar_email', true ) );
$user = esc_attr( get_post_meta( $post->ID, '_user_id', true ) );
@jameskoster
jameskoster / functions.php
Created May 20, 2014 13:30
check for IE
/**
* Check for IE.
*
*/
if ( ! function_exists( 'is_ie' ) ) {
function is_ie ( $version = '6.0' ) {
$supported_versions = array( '6.0', '7.0', '8.0', '9.0', '10' );
$agent = substr( $_SERVER['HTTP_USER_AGENT'], 25, 4 );
$current_version = substr( $_SERVER['HTTP_USER_AGENT'], 30, 3 );
$response = false;
@jameskoster
jameskoster / functions.php
Created May 28, 2014 10:58
Projects - change number of project per row
add_filter( 'projects_loop_columns', 'jk_projects_columns' );
function jk_projects_columns( $columns ) {
$columns = 3;
return $columns;
}
@jameskoster
jameskoster / functions.php
Created June 17, 2014 14:22
Our Team - Speakers
function our_team_speakers_labels( $args ) {
$labels['name'] = __( 'Speakers' );
$labels['add_new_item'] = sprintf( __( 'Add New %s' ), __( 'Speaker' ) );
$labels['add_new'] = _x( 'Add New', 'speaker' );
$labels['singular_name'] = _x( 'Speaker', 'post type singular name' );
$args['labels'] = $labels;
return $args;
}
@jameskoster
jameskoster / functions.php
Created July 15, 2014 13:32
Zephyr - Change email used for header gravatar
add_filter( 'zephyr_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 July 15, 2014 13:33
Zephyr - disable header gravatar
add_filter( 'zephyr_header_gravatar', '__return_false' );
@jameskoster
jameskoster / functions.php
Created October 21, 2014 13:55
Subscribe and Connect adjust social network markup to include nofollow
add_filter( 'subscribe_and_connect_networks_list', 'jk_change_social_links_markup' );
function jk_change_social_links_markup( $list ) {
global $subscribe_and_connect;
$settings = $subscribe_and_connect->get_settings();
$networks = Subscribe_And_Connect_Utils::get_networks_in_order( $settings['connect']['networks'], $settings['connect']['networks_order'] );
$list = '';
if ( 0 < count( $networks ) ) {
foreach ( $networks as $k => $v ) {
if ( ! isset( $v['url'] ) || '' == $v['url'] ) continue;
@jameskoster
jameskoster / functions.php
Created November 11, 2014 09:53
Storefront - Only display post excerpt on archives
add_action( 'init', 'jk_customise_storefront' );
function jk_customise_storefront() {
// Remove the storefromt post content function
remove_action( 'storefront_loop_post', 'storefront_post_content', 30 );
// Add our own custom function
add_action( 'storefront_loop_post', 'jk_custom_storefront_post_content', 30 );
}
@jameskoster
jameskoster / widget.html
Created February 3, 2015 12:09
Storefront - header bar
<div style="text-align: center; background: #000; color: #fff; padding: .53em; font-weight: bold;">
<span style="margin: 0 1em;">Check out our new Jackets!</span>
<span style="margin: 0 1em;">Get 25% off your first order!</span>
<span style="margin: 0 1em;">Free shipping on all orders over $100!</span>
</div>
@jameskoster
jameskoster / style.css
Created March 20, 2015 11:19
Book Store - Content area
.left-sidebar .content-area {
margin-left: 0;
margin-right: 0;
width: 74%;
}
.page-template-template-fullwidth-php .content-area,
.page-template-template-homepage-php .content-area,
.storefront-full-width-content .content-area {
margin-left: 0;