__( 'Widget Area for footer left', 'birdsite' ),
'id' => 'widget-area-footer-left',
'description' => __( 'Widget Area for footer left', 'birdsite' ),
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array (
'name' => __( 'Widget Area for footer center', 'birdsite' ),
'id' => 'widget-area-footer-center',
'description' => __( 'Widget Area for footer center', 'birdsite' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array (
'name' => __( 'Widget Area for footer right', 'birdsite' ),
'id' => 'widget-area-footer-right',
'description' => __( 'Widget Area for footer right', 'birdsite' ),
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
) );
}
add_action( 'widgets_init', 'birdsite_widgets_init' );
//////////////////////////////////////////
// SinglePage Comment callback
function birdsite_custom_comments( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
$birdsite_comment_awaiting = '';
if ( $comment->comment_approved == '0' ) {
$birdsite_comment_awaiting = 'awaiting';
}
?>
id="comment-">
comment_type || 'trackback' == $comment->comment_type ):
$birstips_url = get_comment_author_url();
$birstips_author = get_comment_author();
?>
comment_approved == '0' ) : ?>
" conform WORDPRESS
}
//////////////////////////////////////////////////////
// Pagenation
function birdsite_the_pagenation() {
global $wp_query, $paged;
$birdsite_big = 999999999;
$birdsite_pages = $wp_query -> max_num_pages;
if ( empty( $paged ) ) $paged = 1;
if ( 1 < $birdsite_pages ) {
echo ' ' ."\n";
echo paginate_links( array(
'base' => str_replace( $birdsite_big, '%#%', get_pagenum_link( $birdsite_big ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var( 'paged' ) ),
'total' => $wp_query -> max_num_pages,
'mid_size' => 3,
'prev_text' => __( 'Previous', 'birdsite' ),
'next_text' => __( 'Next', 'birdsite' )
) );
echo '
' ."\n";;
}
}
//////////////////////////////////////////////////////
// Copyright Year
function birdsite_get_copyright_year() {
$birdsite_copyright_year = date( "Y" );
$birdsite_first_year = $birdsite_copyright_year;
$args = array(
'numberposts' => 1,
'orderby' => 'post_date',
'order' => 'ASC',
);
$posts = get_posts( $args );
foreach ( $posts as $post ) {
$birdsite_first_year = mysql2date( 'Y', $post->post_date, true );
}
if( $birdsite_copyright_year <> $birdsite_first_year ){
$birdsite_copyright_year = $birdsite_first_year .' - ' .$birdsite_copyright_year;
}
return $birdsite_copyright_year;
}
//////////////////////////////////////////////////////
// Header Style
function birdsite_header_style() {
?>
'F5F5F5',
) );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => __( 'Navigation Menu', 'birdsite' ),
) );
// Add support for title tag.
add_theme_support( 'title-tag' );
// Add support for custom headers.
add_theme_support( 'custom-header', array(
'default-text-color' => '000',
'default-image' => '',
'height' => 300,
'width' => 600,
'max-width' => 600,
'random-default' => true,
'wp-head-callback' => 'birdsite_header_style',
) );
register_default_headers( array(
'blue' => array(
'url' => '%s/images/headers/blue.jpg',
'thumbnail_url' => '%s/images/headers/blue-thumbnail.jpg',
'description' => 'blue'
),
'yellow' => array(
'url' => '%s/images/headers/yellow.jpg',
'thumbnail_url' => '%s/images/headers/yellow-thumbnail.jpg',
'description' => 'yellow'
),
'pink' => array(
'url' => '%s/images/headers/pink.jpg',
'thumbnail_url' => '%s/images/headers/pink-thumbnail.jpg',
'description' => 'pink'
),
'navy' => array(
'url' => '%s/images/headers/navy.jpg',
'thumbnail_url' => '%s/images/headers/navy-thumbnail.jpg',
'description' => 'navy'
),
'red' => array(
'url' => '%s/images/headers/red.jpg',
'thumbnail_url' => '%s/images/headers/red-thumbnail.jpg',
'description' => 'red'
),
'green' => array(
'url' => '%s/images/headers/green.jpg',
'thumbnail_url' => '%s/images/headers/green-thumbnail.jpg',
'description' => 'green'
),
) );
}
add_action( 'after_setup_theme', 'birdsite_setup' );
//////////////////////////////////////////////////////
// Document Title
function birdsite_title( $title ) {
global $page, $paged;
$title .= get_bloginfo( 'name' );
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title .= " | $site_description";
if ( $paged >= 2 || $page >= 2 )
$title .= ' | ' . sprintf( __( 'Page %s', 'birdsite' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'birdsite_title' );
//////////////////////////////////////////////////////
// Title Tag Backwards Compatibility
function birdsite_slug_render_title() {
?>add_setting( 'birdsite_text_color', array(
'default' => '#555',
'sanitize_callback' => 'maybe_hash_hex_color',
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'birdsite_text_color', array(
'label' => __( 'Text Color', 'birdsite' ),
'section' => 'colors',
'settings' => 'birdsite_text_color',
) ) );
// Link Color
$wp_customize->add_setting( 'birdsite_link_color', array(
'default' => '#06A',
'sanitize_callback' => 'maybe_hash_hex_color',
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'birdsite_link_color', array(
'label' => __( 'Link Color', 'birdsite' ),
'section' => 'colors',
'settings' => 'birdsite_link_color',
) ) );
// Header, Footer Color
$wp_customize->add_setting( 'birdsite_footer_color', array(
'default' => '#000',
'sanitize_callback' => 'maybe_hash_hex_color',
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'birdsite_footer_color', array(
'label' => __( 'Header, Footer Color', 'birdsite' ),
'section' => 'colors',
'settings' => 'birdsite_footer_color',
) ) );
// Navigation Text Color
$wp_customize->add_setting( 'birdsite_navigation_color', array(
'default' => '#555',
'sanitize_callback' => 'maybe_hash_hex_color',
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'birdsite_navigation_color', array(
'label' => __( 'Navigation Text Color', 'birdsite' ),
'section' => 'colors',
'settings' => 'birdsite_navigation_color',
) ) );
// Footer Section
$wp_customize->add_section( 'birdsite_footer', array(
'title' => __( 'Footer', 'birdsite' ),
'priority' => 999,
) );
// Display Copyright
$wp_customize->add_setting( 'birdsite_copyright', array(
'default' => true,
'sanitize_callback' => 'birdsite_sanitize_checkbox',
) );
$wp_customize->add_control( 'birdsite_copyright', array(
'label' => __( 'Display Copyright', 'birdsite' ),
'section' => 'birdsite_footer',
'type' => 'checkbox',
'settings' => 'birdsite_copyright',
) );
// Display Credit
$wp_customize->add_setting( 'birdsite_credit', array(
'default' => true,
'sanitize_callback' => 'birdsite_sanitize_checkbox',
) );
$wp_customize->add_control( 'birdsite_credit', array(
'label' => __( 'Display Credit', 'birdsite' ),
'section' => 'birdsite_footer',
'type' => 'checkbox',
'settings' => 'birdsite_credit',
) );
}
add_action( 'customize_register', 'birdsite_customize' );
//////////////////////////////////////////////////////
// Santize a checkbox
function birdsite_sanitize_checkbox( $input ) {
if ( $input == true ) {
return true;
} else {
return false;
}
}
//////////////////////////////////////////////////////
// Removing the default gallery style
function birdsite_gallery_atts( $out, $pairs, $atts ) {
$atts = shortcode_atts( array( 'size' => 'medium', ), $atts );
$out['size'] = $atts['size'];
return $out;
}
add_filter( 'shortcode_atts_gallery', 'birdsite_gallery_atts', 10, 3 );
add_filter( 'use_default_gallery_style', '__return_false' );