for posts and comments. add_theme_support( 'automatic-feed-links' ); add_theme_support( 'title-tag' ); // Adds support for a custom header image. add_theme_support( 'custom-header', array( // Text color and image (empty to use none). 'default-text-color' => '333333', 'default-image' => '', // Set height and width, with a maximum value for the width. 'height' => 128, 'width' => 960, 'max-width' => 960, // Support flexible height and width. 'flex-height' => true, 'flex-width' => false, // Random image rotation off by default. 'random-default' => false, // Callbacks for styling the header and the admin preview. 'wp-head-callback' => 'blogotron_header_style', 'admin-head-callback' => 'blogotron_admin_header_style', 'admin-preview-callback' => 'blogotron_admin_header_image', ) ); // This theme supports custom background color and image add_theme_support( 'custom-background', array( 'default-color' => 'f5f5f5', ) ); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); // This theme uses wp_nav_menu() in one location. register_nav_menu( 'main', __( 'Main Menu', 'blogotron' ) ); // This theme uses a custom image size for featured images, displayed on "standard" posts. add_theme_support( 'post-thumbnails' ); add_image_size( 'post-featured-image', 528, 9999 ); // Unlimited height, soft crop // Adds support Shortcodes in sidebar widgets. add_filter( 'widget_text', 'do_shortcode' ); } // Registers main widget area area. function blogotron_sidebar() { register_sidebar( array( 'name' => __( 'Main Sidebar', 'blogotron' ), 'id' => 'main-sidebar', 'description' => __( 'Widgets for the sidebar.', 'blogotron' ), 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } // Enqueues scripts and styles for front-end. function blogotron_scripts_styles() { // Loads our main stylesheet. wp_enqueue_style( 'blogotron-style', get_stylesheet_uri() ); //Adds main JavaScript. wp_enqueue_script( 'blogotron-script', get_template_directory_uri() . '/js/script.js', array( 'jquery' ), null, false ); // Enqueue JavaScript translated variables. $string_js = array( 'iFileBrowse' => __( 'Choose file...', 'blogotron' ), 'iFileNotSelected' => __( 'File is not selected.', 'blogotron' ), 'iSearchText' => __( 'Enter search keyword', 'blogotron' ), ); wp_localize_script( 'blogotron-script', 'blogotronStringJs', $string_js ); // Loads the Internet Explorer specific stylesheet. wp_enqueue_style( 'blogotron-ie-style', get_template_directory_uri() . '/styles/ie.css', false, null ); wp_style_add_data( 'blogotron-ie-style', 'conditional', 'lt IE 9' ); // Adds JavaScript to pages with the comment form to support sites with threaded comments (when in use). if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } // Style the header text displayed on the blog. function blogotron_header_style() { $text_color = get_header_textcolor(); // If no custom options for text are set, let's bail if ( get_theme_support( 'custom-header', 'default-text-color' ) == $text_color ) { return; } // If we get this far, we have custom styles. ?> Header admin panel. function blogotron_admin_header_style() { ?> Header admin panel. function blogotron_admin_header_image() { ?>
<?php bloginfo( 'name' ); ?>
$class ) { if ( strstr( $class, 'bypostauthor' ) || strstr( $class, 'byuser' ) || strstr( $class, 'comment-author-' ) ) { unset( $classes[ $key ] ); } } return $classes; } // Show pages navigation. function blogotron_page_nav() { if ( get_previous_posts_link() || get_next_posts_link() ) : ?>
', '« %title' ); previous_post_link( '', '%title »' ); ?> ID ); $thumbnail_image = get_posts( array( 'p' => $thumbnail_id, 'post_type' => 'attachment' ) ); if ( ! empty( $thumbnail_image[0]->post_excerpt ) ) { printf( '

%s

', $thumbnail_image[0]->post_excerpt ); } } // Get attachment image, caption and metadata. function blogotron_the_attachment() { global $post; $attachment = wp_prepare_attachment_for_js( get_the_ID() ); ?>
<?php echo $attachment['title']; ?> %s

', $attachment['caption'] ); } ?>
x post_parent ); ?>
comment_type ) : case 'pingback' : case 'trackback' : // Display trackbacks differently than normal comments. ?>
  • id="comment-">

  • id="li-comment-">
    %1$s %2$s', get_comment_author_link(), // If current post author this is comment author, mark nick by star. ( $comment->user_id === $post->post_author ) ? '*' : '' ); ?>
    comment_approved ) : ?>

    __( 'Reply', 'blogotron' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  • comment_type } add_action( 'after_setup_theme', 'blogotron_setup' ); add_action( 'widgets_init', 'blogotron_sidebar' ); add_action( 'wp_enqueue_scripts', 'blogotron_scripts_styles' ); add_filter( 'comment_class', 'blogotron_comment_class' ); add_action( 'blogotron_page_nav', 'blogotron_page_nav' ); add_action( 'blogotron_post_nav', 'blogotron_post_nav' ); add_action( 'blogotron_the_thumbnail_caption', 'blogotron_the_thumbnail_caption' ); add_action( 'blogotron_the_attachment', 'blogotron_the_attachment' );