' . "\n"; echo '' . "\n"; echo '' . "\n"; } } /***** Page Title Output *****/ if (!function_exists('mh_impact_lite_page_title')) { function mh_impact_lite_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', 'mh-impact-lite'), 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'); } else { _e('Archives', 'mh-impact-lite'); } } else { if (is_home()) { echo get_the_title(get_option('page_for_posts', true)); } elseif (is_404()) { _e('Page not found (404)', 'mh-impact-lite'); } elseif (is_search()) { printf(__('Search Results for %s', 'mh-impact-lite'), esc_attr(get_search_query())); } else { the_title(); } } echo '

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

' . "\n"; echo '' . get_the_date() . '' . "\n"; echo '' . esc_html(get_the_author()) . '' . "\n"; if ('post' == get_post_type()) { echo '' . get_the_category_list(', ', '') . '' . "\n"; } echo '

' . "\n"; } } /***** Featured Image on Posts *****/ if (!function_exists('mh_impact_lite_featured_image')) { function mh_impact_lite_featured_image() { global $page, $post; if (has_post_thumbnail() && $page == '1') { $caption_text = get_post(get_post_thumbnail_id())->post_excerpt; echo "\n" . '
' . "\n"; the_post_thumbnail('blog'); if ($caption_text) { echo '' . esc_attr($caption_text) . '' . "\n"; } echo '
' . "\n"; } } } /***** Custom Excerpts *****/ if (!function_exists('mh_impact_lite_trim_excerpt')) { function mh_impact_lite_trim_excerpt($text = '') { $raw_excerpt = $text; if ('' == $text) { $mh_impact_lite_options = mh_impact_lite_theme_options(); $text = get_the_content(''); $text = do_shortcode($text); $text = apply_filters('the_content', $text); $text = str_replace(']]>', ']]>', $text); $excerpt_length = apply_filters('excerpt_length', esc_attr($mh_impact_lite_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', 'mh_impact_lite_trim_excerpt'); /***** Add Custom Read More Link to Excerpts *****/ if (!function_exists('mh_impact_lite_custom_excerpt_more')) { function mh_impact_lite_custom_excerpt_more() { global $post; $mh_impact_lite_options = mh_impact_lite_theme_options(); $excerpt = get_the_excerpt(); $permalink = get_permalink($post->ID); if ($mh_impact_lite_options['excerpt_more'] != '') { $excerpt .= ' ' . esc_attr($mh_impact_lite_options['excerpt_more']) . '' . "\n"; } return $excerpt; } } add_filter('the_excerpt', 'mh_impact_lite_custom_excerpt_more'); /***** Function for Custom Excerpt Lengths *****/ if (!function_exists('mh_impact_lite_excerpt')) { function mh_impact_lite_excerpt($excerpt_length) { $excerpt = get_the_excerpt(); echo '
' . wp_trim_words($excerpt , $excerpt_length) . '
' . "\n"; } } /***** Pagination *****/ if (!function_exists('mh_impact_lite_pagination')) { function mh_impact_lite_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' => __('«', 'mh-impact-lite'), 'next_text' => __('»', 'mh-impact-lite'), 'total' => $wp_query->max_num_pages )); if ($paginate_links) { echo ''; } } } /***** Pagination for paginated Posts *****/ if (!function_exists('mh_impact_lite_posts_pagination')) { function mh_impact_lite_posts_pagination($content) { if (is_singular() && is_main_query()) { $content .= wp_link_pages(array('before' => '', 'link_before' => '', 'link_after' => '', 'nextpagelink' => __('»', 'mh-impact-lite'), 'previouspagelink' => __('«', 'mh-impact-lite'), 'pagelink' => '%', 'echo' => 0)); } return $content; } } add_filter('the_content', 'mh_impact_lite_posts_pagination', 1); /***** Post / Image Navigation *****/ if (!function_exists('mh_impact_lite_postnav')) { function mh_impact_lite_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('mh_impact_lite_comments')) { function mh_impact_lite_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', 'mh_impact_lite_comment_fields'); /***** Add CSS classes to body tag *****/ if (!function_exists('mh_impact_lite_body_class')) { function mh_impact_lite_body_class($classes) { $mh_impact_lite_options = mh_impact_lite_theme_options(); $classes[] = 'mh-' . $mh_impact_lite_options['sidebar'] . '-sb'; return $classes; } } add_filter('body_class', 'mh_impact_lite_body_class'); /***** Add CSS3 Media Queries Support for older versions of IE *****/ function mh_impact_lite_ie_media_queries() { echo '' . "\n"; } add_action('wp_head', 'mh_impact_lite_ie_media_queries'); ?>