' . "\n"; } } add_action('mh_before_header', 'mh_magazine_boxed_container_open'); if (!function_exists('mh_magazine_boxed_container_close')) { function mh_magazine_boxed_container_close() { mh_before_container_close(); echo '' . "\n"; } } add_action('mh_after_footer', 'mh_magazine_boxed_container_close'); /***** Custom Header *****/ if (!function_exists('mh_magazine_lite_custom_header')) { function mh_magazine_lite_custom_header() { echo '
' . "\n"; if (get_header_image()) { echo '' . "\n"; echo '' . esc_attr(get_bloginfo('name')) . '' . "\n"; echo '' . "\n"; } if (function_exists('has_custom_logo') && has_custom_logo() || display_header_text()) { echo '
' . "\n"; echo '' . "\n"; echo '
' . "\n"; } echo '
' . "\n"; } } /***** Modify Prefix of Titles on Archives *****/ if (!function_exists('mh_magazine_lite_archive_title_prefix')) { function mh_magazine_lite_archive_title_prefix($title) { if (is_category()) { $title = single_cat_title('', false); } elseif (is_tag()) { $title = single_tag_title('', false); } elseif (is_author()) { $title = sprintf(esc_html__('Articles by %s', 'mh-magazine-lite'), '' . get_the_author() . ''); } return $title; } } add_filter('get_the_archive_title', 'mh_magazine_lite_archive_title_prefix'); /***** Post Meta *****/ if (!function_exists('mh_magazine_lite_post_meta')) { function mh_magazine_lite_post_meta() { echo '

' . "\n"; echo '' . get_the_date() . '' . "\n"; echo '' . esc_html(get_the_author()) . '' . "\n"; echo '' . get_the_category_list(', ', '') . '' . "\n"; echo '' . get_comments_number() . '' . "\n"; echo '

' . "\n"; } } add_action('mh_post_header', 'mh_magazine_lite_post_meta'); /***** Post Meta (Loop) *****/ if (!function_exists('mh_magazine_lite_loop_meta')) { function mh_magazine_lite_loop_meta() { echo '' . get_the_date() . '' . "\n"; if (in_the_loop()) { echo '' . esc_html(get_the_author()) . '' . "\n"; } echo ''; mh_magazine_lite_comment_count(); echo '' . "\n"; } } /***** Featured Image on Posts *****/ if (!function_exists('mh_magazine_lite_featured_image')) { function mh_magazine_lite_featured_image() { global $page, $post; if (has_post_thumbnail() && $page == '1' && !is_attachment()) { $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'mh-magazine-lite-content'); echo "\n" . '
' . "\n"; echo '' . esc_attr(get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true)) . '' . "\n"; if (get_post(get_post_thumbnail_id())->post_excerpt) { echo '
' . wp_kses_post(get_post(get_post_thumbnail_id())->post_excerpt) . '
' . "\n"; } echo '
' . "\n"; } } } /***** Author box *****/ if (!function_exists('mh_magazine_lite_author_box')) { function mh_magazine_lite_author_box() { $mh_magazine_lite_options = mh_magazine_lite_theme_options(); $mh_author_box_ID = get_the_author_meta('ID'); if ($mh_magazine_lite_options['author_box'] == 'enable' && get_the_author_meta('description', $mh_author_box_ID) && !is_attachment()) { get_template_part('content', 'author-box'); } } } add_action('mh_after_post_content', 'mh_magazine_lite_author_box'); /***** Post / Attachment Navigation *****/ if (!function_exists('mh_magazine_lite_postnav')) { function mh_magazine_lite_postnav() { $mh_magazine_lite_options = mh_magazine_lite_theme_options(); if ($mh_magazine_lite_options['post_nav'] === 'enable') { global $post; $parent_post = get_post($post->post_parent); $attachment = is_attachment(); $prev_post = get_previous_post(); $next_post = get_next_post(); if (!empty($prev_post) || !empty($next_post) || $attachment) { echo '' . "\n"; } } } } add_action('mh_after_post_content', 'mh_magazine_lite_postnav'); /***** Custom Excerpts *****/ if (!function_exists('mh_magazine_lite_excerpt_length')) { function mh_magazine_lite_excerpt_length($length) { $mh_magazine_lite_options = mh_magazine_lite_theme_options(); $excerpt_length = absint($mh_magazine_lite_options['excerpt_length']); return $excerpt_length; } } add_filter('excerpt_length', 'mh_magazine_lite_excerpt_length', 999); if (!function_exists('mh_magazine_lite_excerpt_more')) { function mh_magazine_lite_excerpt_more($more) { global $post; $mh_magazine_lite_options = mh_magazine_lite_theme_options(); return ' ' . esc_attr($mh_magazine_lite_options['excerpt_more']) . ''; } } add_filter('excerpt_more', 'mh_magazine_lite_excerpt_more'); if (!function_exists('mh_magazine_lite_excerpt_markup')) { function mh_magazine_lite_excerpt_markup($excerpt) { $markup = '
' . $excerpt . '
'; return $markup; } } add_filter('the_excerpt', 'mh_magazine_lite_excerpt_markup'); /***** Custom Commentlist *****/ if (!function_exists('mh_magazine_lite_comments')) { function mh_magazine_lite_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • >
    comment_author_email, 80); ?>
    comment_approved == '0') { ?>
    '

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

    ', 'email' => '

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

    ', 'url' => '


    ' ); return $fields; } } add_filter('comment_form_default_fields', 'mh_magazine_lite_comment_fields'); /***** Comment Count Output *****/ if (!function_exists('mh_magazine_lite_comment_count')) { function mh_magazine_lite_comment_count() { echo '' . get_comments_number() . ''; } } /***** Pagination *****/ if (!function_exists('mh_magazine_lite_pagination')) { function mh_magazine_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' => esc_html__('«', 'mh-magazine-lite'), 'next_text' => esc_html__('»', 'mh-magazine-lite'), 'total' => $wp_query->max_num_pages) ); if ($paginate_links) { echo '
    '; echo $paginate_links; echo '
    '; } } } /***** Pagination for paginated Posts *****/ if (!function_exists('mh_magazine_lite_paginated_posts')) { function mh_magazine_lite_paginated_posts($content) { if (is_singular() && in_the_loop()) { $content .= wp_link_pages(array('before' => '', 'link_before' => '', 'link_after' => '', 'nextpagelink' => __('»', 'mh-magazine-lite'), 'previouspagelink' => __('«', 'mh-magazine-lite'), 'pagelink' => '%', 'echo' => 0)); } return $content; } } add_filter('the_content', 'mh_magazine_lite_paginated_posts', 1); /***** Modify Appearance of WP Tag Cloud Widget *****/ if (!function_exists('mh_magazine_lite_custom_tag_cloud')) { function mh_magazine_lite_custom_tag_cloud($args) { $args['smallest'] = 12; $args['largest'] = 12; $args['unit'] = 'px'; return $args; } } add_filter('widget_tag_cloud_args', 'mh_magazine_lite_custom_tag_cloud'); /***** Add Featured Image Size to Media Gallery Selection *****/ if (!function_exists('mh_magazine_lite_media_selection')) { function mh_magazine_lite_media_selection($sizes) { $custom_sizes = array('mh-magazine-lite-content' => 'Featured Image'); return array_merge($sizes, $custom_sizes); } } add_filter('image_size_names_choose', 'mh_magazine_lite_media_selection'); /***** Add CSS3 Media Queries Support for older versions of IE *****/ function mh_magazine_lite_media_queries() { echo '' . "\n"; } add_action('wp_head', 'mh_magazine_lite_media_queries'); ?>