for posts and comments //add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat', ) ); // post formats for future register_nav_menu( 'primary-nav', __( 'Primary menu', 'activetab' ) ); // main nav menu in header add_theme_support( 'custom-background' ); add_theme_support( 'post-thumbnails' ); // featured images set_post_thumbnail_size( 800, 9999 ); // unlimited height, soft crop $custom_header_args = array( 'default-image' => get_template_directory_uri() . '/img/headers/borabora.jpg', 'random-default' => true, // random image rotation 'header-text' => false, // disable editing styles for text in header // set height and width, with a maximum value for the width 'width' => 800, 'height' => 500, 'max-width' => 2000, // support flexible height and width 'flex-height' => true, 'flex-width' => true ); add_theme_support( 'custom-header', $custom_header_args ); // custom header See http://codex.wordpress.org/Custom_Headers // default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI register_default_headers( array( 'field' => array( 'url' => '%s/img/headers/field.jpg', 'thumbnail_url' => '%s/img/headers/field-thumbnail.jpg', 'description' => __( 'Field', 'activetab' ) ), 'beach' => array( 'url' => '%s/img/headers/beach.jpg', 'thumbnail_url' => '%s/img/headers/beach-thumbnail.jpg', 'description' => __( 'Beach', 'activetab' ) ), 'sun' => array( 'url' => '%s/img/headers/sun.jpg', 'thumbnail_url' => '%s/img/headers/sun-thumbnail.jpg', 'description' => __( 'Sun', 'activetab' ) ) ) ); /* ========== thumbnail size options ========== */ //add_image_size( 'thumb-400', 400, 999, false ); //add_image_size( 'thumb-200', 200, 999, false ); //add_image_size( 'thumb-100', 100, 999, false ); /* to add more sizes, simply copy a line from above and change the dimensions & name. As long as you upload a "featured image" as large as the biggest set width or height, all the other sizes will be auto-cropped. - shows the 200x200 sized image */ function activetab_add_customize_to_admin_menu() { // add the 'Customize' link to the admin menu add_theme_page( 'Customize', 'Customize', 'edit_theme_options', 'customize.php' ); } add_action( 'admin_menu', 'activetab_add_customize_to_admin_menu' ); } add_action( 'after_setup_theme', 'activetab_setup' ); endif; // register sidebars & footer widgets if ( ! function_exists( 'activetab_register_widgets' ) ) : function activetab_register_widgets() { register_sidebar( array( 'name' => __( 'Sidebar', 'activetab' ), 'id' => 'sidebar', //'description' => 'Sidebar widgets description.', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => __( 'Footer', 'activetab' ), 'id' => 'footer', //'description' => 'description', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'activetab_register_widgets' ); endif; if ( ! function_exists( 'activetab_list_pages' ) ) : function activetab_list_pages() { ?> = 2 || $page >= 2 ) $title .= ' ' . $sep . ' ' . sprintf( __( 'page %s', 'activetab' ), max( $paged, $page ) ); $title = wptexturize( $title ); return $title; } add_filter( 'wp_title', 'activetab_title', 10, 2 ); endif; if ( ! function_exists( 'activetab_comments' ) ) : function activetab_comments( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case 'pingback' : case 'trackback' : ?>
  • '.__( 'edit', 'activetab' ), '', '' ); ?>

  • id="li-comment-">
    comment_parent ){ $avatar_size = 30; // small image for reply } $comment_author_url = get_comment_author_url(); if( !empty( $comment_author_url ) ){ // create a link on avatar $comment_avatar_url_before = ''; $comment_avatar_url_after = ''; }else{ $comment_avatar_url_before = ''; $comment_avatar_url_after = ''; } global $post; if( $comment->user_id === $post->post_author ) { $post_author_label = ' '.__( 'Post author', 'activetab' ).''; } else { $post_author_label = ''; } echo '
    '.$comment_avatar_url_before.get_avatar( $comment, $avatar_size ).$comment_avatar_url_after.'
    '; echo '
    '; echo ' '.get_comment_author_link().$post_author_label.' '; echo ' '; edit_comment_link( __( 'edit', 'activetab' ), ' ', '' ); echo '
    '; ?>
    comment_approved == '0' ) : ?>

    ''.__( 'reply', 'activetab' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    '.''."\n"; return $post_date; } endif; // activetab_post_date if ( ! function_exists( 'activetab_post_author' ) ) : function activetab_post_author() { // author global $authordata; if ( !is_object( $authordata ) ) return false; $post_author = ' '."\n"; return $post_author; } endif; // activetab_post_author if ( ! function_exists( 'activetab_comments_count' ) ) : function activetab_comments_count() { $post_comments_count = ''; if( get_comments_number() != '0' ) { $post_comments_count = ' '.get_comments_number().''."\n"; } return $post_comments_count; } endif; // activetab_comments_count if ( ! function_exists( 'activetab_post_categories' ) ) : function activetab_post_categories() { // list of categories $post_categories = get_the_category_list( ', ' ); if( !empty( $post_categories ) ){ return ' '.$post_categories.''."\n"; }else{ return ''; // no categories } } endif; // activetab_post_categories if ( ! function_exists( 'activetab_post_tags' ) ) : function activetab_post_tags() { // list of tags $post_tags = get_the_tag_list( '', ', ', '' ); if( !empty( $post_tags ) ){ return ' '.$post_tags.''."\n"; }else{ return ''; // no tags } } endif; // activetab_post_tags if ( ! function_exists( 'activetab_post_meta' ) ) : function activetab_post_meta() { // post meta $post_meta = '
    '."\n" . activetab_post_date() . activetab_post_author() . activetab_comments_count() . activetab_post_categories() . '
    '."\n"; $post_tags = activetab_post_tags(); if( !empty( $post_tags ) && is_single() ){ $post_meta .= '
    '."\n" . $post_tags . '
    '."\n"; } return "\n".'
    '."\n".$post_meta.'
    '."\n"; } endif; // activetab_post_meta if ( ! function_exists( 'activetab_nav' ) ) : function activetab_nav( $class='top' ) { // show next/prev navigation links when needed global $wp_query; $nav = ''; if ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) : // navigation links for home, archive, and search pages if ( get_next_posts_link() ) : $nav .= '
  • '; endif; if ( get_previous_posts_link() ) : $nav .= ''; endif; endif; if( !empty( $nav ) ) { // do not show empty markup $nav = "\n".' '."\n"; } return $nav; } endif; // activetab_nav if ( ! function_exists( 'activetab_excerpt_more' ) ) : function activetab_excerpt_more( $more ) { // "more-link" is bad for seo and for usability - http://web-profile.com.ua/web/web-principles/more-link/ return '...'; } add_filter('excerpt_more', 'activetab_excerpt_more'); endif; // activetab_excerpt_more if ( ! function_exists( 'activetab_is_homepage' ) ) : function activetab_is_homepage(){ // does not used, simple way was chosen // if( is_home() || is_front_page() ){} // simple way $show_on_front = get_option('show_on_front'); // page or posts $page_on_front = get_option('page_on_front'); // 0 or page_id $page_for_posts = get_option('page_for_posts'); // 0 or page_id if ( ($show_on_front == 'page') || ($page_on_front != 0) ){ if( is_front_page() ){ return true; } } elseif ( ( $show_on_front == 'posts' ) || ( $page_for_posts == 0 ) ) { if( is_home() ){ return true; } } else { return false; } } endif; // activetab_is_homepage if ( ! function_exists( 'activetab_remove_thumbnail_dimensions' ) ) : function activetab_remove_thumbnail_dimensions( $html ) { // Remove height/width attributes on images so they can be responsive $html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html ); return $html; } add_filter( 'post_thumbnail_html', 'activetab_remove_thumbnail_dimensions', 10 ); add_filter( 'image_send_to_editor', 'activetab_remove_thumbnail_dimensions', 10 ); endif; // activetab_remove_thumbnail_dimensions