' . "\n"; echo '' . "\n"; if (display_header_text()) { $text_color = get_header_textcolor(); if ($text_color != get_theme_support('custom-header', 'default-text-color')) { echo '' . "\n"; } echo '' . "\n"; } echo '' . "\n"; echo '' . "\n"; } } /***** Page Title Output *****/ if (!function_exists('fc_benews_page_title')) { function fc_benews_page_title() { if (!is_front_page()) { echo '

'; if (is_archive()) { if (is_category() || is_tax()) { single_cat_title(); } elseif (is_tag()) { single_tag_title(); } elseif (is_author()) { global $author; $user_info = get_userdata($author); printf(_x('Articles by %s', 'post author', 'benews'), esc_attr($user_info->display_name)); } elseif (is_day()) { echo get_the_date(); } elseif (is_month()) { echo get_the_date('F Y'); } elseif (is_year()) { echo get_the_date('Y'); } elseif (is_post_type_archive()) { global $post; $post_type = get_post_type_object(get_post_type($post)); echo $post_type->labels->name; } else { _e('Archives', 'benews'); } } else { if (is_home()) { echo get_the_title(get_option('page_for_posts', true)); } elseif (is_404()) { _e('Page not found (404)', 'benews'); } elseif (is_search()) { printf(__('Search Results for %s', 'benews'), esc_attr(get_search_query())); } else { the_title(); } } echo '

' . "\n"; } } } /***** Output Post Meta Data *****/ if (!function_exists('fc_benews_post_meta')) { function fc_benews_post_meta() { echo '

' . "\n"; if (has_category() && !is_single()) { echo '' . get_the_category_list(', ', '') . '' . "\n"; } if (is_single()) { echo '' . sprintf(_x('Posted By: %s', 'post author', 'benews'), '' . esc_html(get_the_author()) . '') . '' . "\n"; } echo '' . get_the_date() . '' . "\n"; echo '

' . "\n"; } } /***** Featured Image on Posts *****/ if (!function_exists('fc_benews_featured_image')) { function fc_benews_featured_image() { global $page, $post; if (has_post_thumbnail() && $page == '1') { $caption_text = get_post(get_post_thumbnail_id())->post_excerpt; if($caption_text == "") { $caption_text = get_post(get_post_thumbnail_id())->post_content; } echo "\n" . '
' . "\n"; the_post_thumbnail('content-single'); if ($caption_text) { echo '' . wp_kses_post($caption_text) . '' . "\n"; } echo '
' . "\n"; } } } /***** Custom Excerpts *****/ if (!function_exists('fc_benews_trim_excerpt')) { function fc_benews_trim_excerpt($text = '') { $raw_excerpt = $text; if ('' == $text) { $fc_benews_options = fc_benews_theme_options(); $text = get_the_content(''); $text = strip_shortcodes($text); $text = apply_filters('the_content', $text); $text = str_replace(']]>', ']]>', $text); $excerpt_length = apply_filters('excerpt_length', $fc_benews_options['excerpt_length']); $excerpt_more = apply_filters('excerpt_more', '...'); $text = wp_trim_words($text, $excerpt_length, $excerpt_more); } return apply_filters('wp_trim_excerpt', $text, $raw_excerpt); } } remove_filter('get_the_excerpt', 'wp_trim_excerpt'); add_filter('get_the_excerpt', 'fc_benews_trim_excerpt'); /***** Pagination *****/ if (!function_exists('fc_benews_pagination')) { function fc_benews_pagination() { global $wp_query; $big = 9999; $paginate_links = paginate_links(array( 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), 'format' => '?paged=%#%', 'current' => max(1, get_query_var('paged')), 'prev_next' => true, 'prev_text' => __('«', 'benews'), 'next_text' => __('»', 'benews'), 'total' => $wp_query->max_num_pages )); if ($paginate_links) { echo ''; } } } /***** Pagination for paginated Posts *****/ if (!function_exists('fc_benews_posts_pagination')) { function fc_benews_posts_pagination($content) { if (is_singular() && is_main_query()) { $content .= wp_link_pages(array('before' => '', 'link_before' => '', 'link_after' => '', 'nextpagelink' => __('»', 'benews'), 'previouspagelink' => __('«', 'benews'), 'pagelink' => '%', 'echo' => 0)); } return $content; } } add_filter('the_content', 'fc_benews_posts_pagination', 1); /***** Post / Image Navigation *****/ if (!function_exists('fc_benews_postnav')) { function fc_benews_postnav() { global $post; $parent_post = get_post($post->post_parent); $attachment = is_attachment(); $previous = ($attachment) ? $parent_post : get_adjacent_post(false, '', true); $next = get_adjacent_post(false, '', false); if (!$next && !$previous) return; if ($attachment) { $attachments = get_children(array('post_type' => 'attachment', 'post_mime_type' => 'image', 'post_parent' => $parent_post->ID)); $count = count($attachments); } echo '' . "\n"; } } /***** Custom Commentlist *****/ if (!function_exists('fc_benews_comments')) { function fc_benews_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • id="li-comment-">
    comment_author_email, 70); ?> | | $depth, 'max_depth' => $args['max_depth']))) ?>
    comment_approved == '0') : ?>
    '

    ' . ($req ? '*' : '') . '

    ', 'email' => '

    ' . ($req ? '*' : '' ) . '

    ', 'url' => '


    ' ); return $fields; } } add_filter('comment_form_default_fields', 'fc_benews_comment_fields'); /***** Read More Button *****/ function fc_benews_more() { $fc_benews_options = fc_benews_theme_options(); ?> ' . "\n"; echo '' . "\n"; echo '' . "\n"; } add_action('wp_head', 'fc_benews_ie_media_queries');