add_data( 'BIGPIX-ie-only', 'conditional', 'lt IE 9' ); // add conditional wrapper around ie stylesheet
}
/*********************
THEME SUPPORT
*********************/
// Adding WP 3+ Functions & Theme Support
function BIGPIX_theme_support() {
// wp thumbnails (sizes handled in functions.php)
add_theme_support( 'post-thumbnails' );
add_editor_style(get_template_directory_uri(). '/library/css/editor-style.css');
// default thumb size
set_post_thumbnail_size(125, 125, true);
// wp custom background (thx to @bransonwerner for update)
add_theme_support( 'custom-background',
array(
'default-image' => '', // background image default
'default-color' => 'ffffff', // background color default (dont add the #)
'wp-head-callback' => '_custom_background_cb',
'admin-head-callback' => '',
'admin-preview-callback' => ''
)
);
// rss thingy
add_theme_support('automatic-feed-links');
// to add header image support go here: http://themble.com/support/adding-header-background-image-support/
// adding post format support
add_theme_support( 'post-formats',
array(
'aside', // title less blurb
'gallery', // gallery of images
'link', // quick link to other site
'image', // an image
'quote', // a quick quote
'status', // a Facebook like status update
'video', // video
'audio', // audio
'chat' // chat transcript
)
);
add_theme_support( 'title-tag' );
add_theme_support( 'custom-logo', array(
'height' => 40,
'width' => 350,
'flex-width' => true,
) );
} /* end bigpix theme support */
/*********************
RELATED POSTS FUNCTION
*********************/
// Related Posts Function (call using BIGPIX_related_posts(); )
function BIGPIX_related_posts() {
echo '
';
global $post;
$tags = wp_get_post_tags( $post->ID );
if($tags) {
foreach( $tags as $tag ) {
$tag_arr = "";
$tag_arr .= $tag->slug . ',';
}
$args = array(
'tag' => $tag_arr,
'numberposts' => 5, /* you can change this to show more */
'post__not_in' => array($post->ID)
);
$related_posts = get_posts( $args );
if($related_posts) {
foreach ( $related_posts as $post ) : setup_postdata( $post ); ?>
' . __( 'No Related Posts Yet!', 'big-pix' ) . ''; ?>
';
} /* end bigpix related posts function */
/*********************
PAGE NAVI
*********************/
// Numeric Page Navi (built into the theme by default)
function BIGPIX_page_navi() {
global $wp_query, $paged;
$bignum = 999999999;
if ( $wp_query->max_num_pages <= 1 )
return;
echo '';
} /* end page navi */
/*********************
RANDOM CLEANUP ITEMS
*********************/
// remove the p from around imgs (http://css-tricks.com/snippets/wordpress/remove-paragraph-tags-from-around-images/)
function BIGPIX_filter_ptags_on_images($content){
return preg_replace('/\s*()?\s*(
)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content);
}
// This removes the annoying […] to a Read More link
function BIGPIX_excerpt_more($more) {
global $post;
// edit here if you like
return '... '. __( 'Read more »', 'big-pix' ) .'';
}
/*video*/
if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => 'acf_video',
'title' => 'Video',
'fields' => array (
array (
'key' => 'field_542906321cdab',
'label' => __('Embed Video','big-pix'),
'name' => 'wpdevshed_post_format_embed_video',
'type' => 'textarea',
'default_value' => '',
'placeholder' => '',
'maxlength' => '',
'rows' => '',
'formatting' => 'html',
),
),
'location' => array (
array (
array (
'param' => 'post_format',
'operator' => '==',
'value' => 'video',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'no_box',
'hide_on_screen' => array (
),
),
'menu_order' => 0,
));
}
/*link*/
if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => 'acf_link',
'title' => 'Link',
'fields' => array (
array (
'key' => 'field_54290c22892fe',
'label' => __('Link','big-pix'),
'name' => 'wpdevshed_post_format_link_url',
'type' => 'text',
'instructions' => 'place url here',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'none',
'maxlength' => '',
),
),
'location' => array (
array (
array (
'param' => 'post_format',
'operator' => '==',
'value' => 'link',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'no_box',
'hide_on_screen' => array (
),
),
'menu_order' => 0,
));
}
/*quote*/
if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => 'acf_quote',
'title' => 'Quote',
'fields' => array (
array (
'key' => 'field_5428fc13708c4',
'label' => __('Quote Content','big-pix'),
'name' => 'wpdevshed_post_format_quote_content',
'type' => 'textarea',
'default_value' => '',
'placeholder' => '',
'maxlength' => '',
'rows' => '',
'formatting' => 'none',
),
array (
'key' => 'field_5428fc4e3e3fc',
'label' => __('Quote Source','big-pix'),
'name' => 'wpdevshed_post_format_quote_source',
'type' => 'text',
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'formatting' => 'none',
'maxlength' => '',
),
),
'location' => array (
array (
array (
'param' => 'post_format',
'operator' => '==',
'value' => 'quote',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'no_box',
'hide_on_screen' => array (
),
),
'menu_order' => 0,
));
}
if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => 'acf_audio',
'title' => 'Audio',
'fields' => array (
array (
'key' => 'field_542a4c44cc3c2',
'label' => __('Upload Audio File Here','big-pix'),
'name' => 'wpdevshed_post_format_audio_content',
'type' => 'file',
'save_format' => 'url',
'library' => 'all',
),
),
'location' => array (
array (
array (
'param' => 'post_format',
'operator' => '==',
'value' => 'audio',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'no_box',
'hide_on_screen' => array (
),
),
'menu_order' => 0,
));
}
if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => 'acf_status',
'title' => 'Status',
'fields' => array (
array (
'key' => 'field_542a5b07626a0',
'label' => __('Insert Short Status Here','big-pix'),
'name' => 'wpdevshed_post_format_status_content',
'type' => 'textarea',
'default_value' => '',
'placeholder' => '',
'maxlength' => '',
'rows' => '',
'formatting' => 'none',
),
),
'location' => array (
array (
array (
'param' => 'post_format',
'operator' => '==',
'value' => 'status',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'no_box',
'hide_on_screen' => array (
),
),
'menu_order' => 0,
));
}
if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => 'acf_chat',
'title' => 'Chat',
'fields' => array (
array (
'key' => 'field_542a5d28507df',
'label' => __('Insert Chat Conversation here','big-pix'),
'name' => 'wpdevshed_post_format_chat_content',
'type' => 'wysiwyg',
'default_value' => '',
'toolbar' => 'basic',
'media_upload' => 'yes',
),
),
'location' => array (
array (
array (
'param' => 'post_format',
'operator' => '==',
'value' => 'chat',
'order_no' => 0,
'group_no' => 0,
),
),
),
'options' => array (
'position' => 'normal',
'layout' => 'no_box',
'hide_on_screen' => array (
),
),
'menu_order' => 0,
));
}