%2$s'; if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { $time_string = ''; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); $posted_on = sprintf( esc_html_x( 'Posted on %s', 'post date', 'magzen' ), '' . $time_string . '' ); $byline = sprintf( esc_html_x( 'by %s', 'post author', 'magzen' ), '' . esc_html( get_the_author() ) . '' ); echo '' . $posted_on . ' ' . $byline . ''; // WPCS: XSS OK. } endif; if ( ! function_exists( 'magzen_entry_footer' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function magzen_entry_footer() { // Hide category and tag text for pages. if ( 'post' === get_post_type() ) { /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( esc_html__( ', ', 'magzen' ) ); if ( $categories_list && magzen_categorized_blog() ) { printf( '' . esc_html__( 'Posted in %1$s', 'magzen' ) . '', $categories_list ); // WPCS: XSS OK. } /* translators: used between list items, there is a space after the comma */ $tags_list = get_the_tag_list( '', esc_html__( ', ', 'magzen' ) ); if ( $tags_list ) { printf( '' . esc_html__( 'Tagged %1$s', 'magzen' ) . '', $tags_list ); // WPCS: XSS OK. } } if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ''; /* translators: %s: post title */ comments_popup_link( sprintf( wp_kses( __( 'Leave a Comment on %s', 'magzen' ), array( 'span' => array( 'class' => array() ) ) ), get_the_title() ) ); echo ''; } edit_post_link( sprintf( /* translators: %s: Name of current post */ esc_html__( 'Edit %s', 'magzen' ), the_title( '"', '"', false ) ), '', '' ); } endif; /** * Returns true if a blog has more than 1 category. * * @return bool */ function magzen_categorized_blog() { if ( false === ( $all_the_cool_cats = get_transient( 'magzen_categories' ) ) ) { // Create an array of all the categories that are attached to posts. $all_the_cool_cats = get_categories( array( 'fields' => 'ids', 'hide_empty' => 1, // We only need to know if there is more than one category. 'number' => 2, ) ); // Count the number of categories that are attached to the posts. $all_the_cool_cats = count( $all_the_cool_cats ); set_transient( 'magzen_categories', $all_the_cool_cats ); } if ( $all_the_cool_cats > 1 ) { // This blog has more than 1 category so magzen_categorized_blog should return true. return true; } else { // This blog has only 1 category so magzen_categorized_blog should return false. return false; } } /** * Flush out the transients used in magzen_categorized_blog. */ function magzen_category_transient_flusher() { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } // Like, beat it. Dig? delete_transient( 'magzen_categories' ); } add_action( 'edit_category', 'magzen_category_transient_flusher' ); add_action( 'save_post', 'magzen_category_transient_flusher' ); /* Theme Related Functions */ if ( ! function_exists( 'magzen_post_nav' ) ) : /** * Display navigation to next/previous post when applicable. */ function magzen_post_nav() { // Don't print empty markup if there's nowhere to navigate. $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) { return; } ?> '; break; case '1': default: $delimiter = ' » '; break; } } $before = ''; // tag before the current crumb $after = ''; // tag after the current crumb /* === END OF OPTIONS === */ global $post; $homeLink = home_url() . '/'; $linkBefore = ''; $linkAfter = ''; $linkAttr = ' rel="v:url" property="v:title"'; $link = $linkBefore . '%2$s' . $linkAfter; if (is_home() || is_front_page()) { if ($showOnHome == 1) echo '
' . $text['home'] . '
'; } else { echo '
' . sprintf($link, $homeLink, $text['home']) . $delimiter; if ( is_category() ) { $thisCat = get_category(get_query_var('cat'), false); if ($thisCat->parent != 0) { $cats = get_category_parents($thisCat->parent, TRUE, $delimiter); $cats = str_replace('', '' . $linkAfter, $cats); echo $cats; } echo $before . sprintf($text['category'], single_cat_title('', false)) . $after; } elseif ( is_search() ) { echo $before . sprintf($text['search'], get_search_query()) . $after; } elseif ( is_day() ) { echo sprintf($link, get_year_link(get_the_time('Y')), get_the_time('Y')) . $delimiter; echo sprintf($link, get_month_link(get_the_time('Y'),get_the_time('m')), get_the_time('F')) . $delimiter; echo $before . get_the_time('d') . $after; } elseif ( is_month() ) { echo sprintf($link, get_year_link(get_the_time('Y')), get_the_time('Y')) . $delimiter; echo $before . get_the_time('F') . $after; } elseif ( is_year() ) { echo $before . get_the_time('Y') . $after; } elseif ( is_single() && !is_attachment() ) { if ( get_post_type() != 'post' ) { $post_type = get_post_type_object(get_post_type()); printf($link, get_post_type_archive_link(get_post_type()), $post_type->labels->singular_name); if ($showCurrent == 1) echo $delimiter . $before . get_the_title() . $after; } else { $cat = get_the_category(); $cat = $cat[0]; $cats = get_category_parents($cat, TRUE, $delimiter); if ($showCurrent == 0) $cats = preg_replace("#^(.+)$delimiter$#", "$1", $cats); $cats = str_replace('', '' . $linkAfter, $cats); echo $cats; if ($showCurrent == 1) echo $before . get_the_title() . $after; } } elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) { $post_type = get_post_type_object(get_post_type()); echo $before . $post_type->labels->singular_name . $after; } elseif ( is_attachment() ) { $parent = get_post($post->post_parent); $cat = get_the_category($parent->ID); $cat = $cat[0]; $cats = get_category_parents($cat, TRUE, $delimiter); $cats = str_replace('', '' . $linkAfter, $cats); echo $cats; printf($link, get_permalink($parent), $parent->post_title); if ($showCurrent == 1) echo $delimiter . $before . get_the_title() . $after; } elseif ( is_page() && !$post->post_parent ) { if ($showCurrent == 1) echo $before . get_the_title() . $after; } elseif ( is_page() && $post->post_parent ) { $parent_id = $post->post_parent; $breadcrumbs = array(); while ($parent_id) { $page = get_page($parent_id); $breadcrumbs[] = sprintf($link, get_permalink($page->ID), get_the_title($page->ID)); $parent_id = $page->post_parent; } $breadcrumbs = array_reverse($breadcrumbs); for ($i = 0; $i < count($breadcrumbs); $i++) { echo $breadcrumbs[$i]; if ($i != count($breadcrumbs)-1) echo $delimiter; } if ($showCurrent == 1) echo $delimiter . $before . get_the_title() . $after; } elseif ( is_tag() ) { echo $before . sprintf($text['tag'], single_tag_title('', false)) . $after; } elseif ( is_author() ) { global $author; $userdata = get_userdata($author); echo $before . sprintf($text['author'], $userdata->display_name) . $after; } elseif ( is_404() ) { echo $before . $text['404'] . $after; } if ( get_query_var('paged') ) { if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ' ('; echo __('Page', 'magzen' ) . ' ' . get_query_var('paged'); if ( is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author() ) echo ')'; } echo '
'; } } // end magzen_breadcrumbs() } // Related Posts Function by Tags (call using magzen_related_posts(); ) /NecessarY/ May be write a shortcode? if ( ! function_exists( 'magzen_related_posts' ) ) : function magzen_related_posts() { echo ''; } endif; /* More tag wrapper */ add_action( 'the_content_more_link', 'magzen_add_more_link_class', 10, 2 ); if ( ! function_exists( 'magzen_add_more_link_class' ) ) : function magzen_add_more_link_class($link, $text ) { return '

'.__('Read More','magzen').'

'; } endif; /* Magazine Post meta details */ if ( ! function_exists( 'magzen_entry_top_meta' ) ) : /** * Prints HTML with meta information for the categories, tags and comments. */ function magzen_entry_top_meta($date = 'date',$author = 'author', $comment = 'comment', $cat = 'cat', $tag = 'tag', $edit = 'edit' ) { // Post meta data if ( 'post' == get_post_type() ) { // Date global $post; if ( 'date' == $date ) { ?> ' . esc_html( get_the_author() ) . '' ); } // Comments if ( 'comment' == $comment ) { if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) { echo ' '; comments_popup_link( __( 'Leave a comment', 'magzen' ), __( '1 Comment', 'magzen' ), __( '% Comments', 'magzen' ) ); echo ''; } } // Category list if ( 'cat' == $cat ) { $categories_list = get_the_category_list( __( ', ', 'magzen' ) ); if ( $categories_list ) { printf( ' ' . __( '%1$s ', 'magzen' ) . '', $categories_list ); } } // Tags if ( 'tag' == $tag ) { $tags_list = get_the_tag_list( '', __( ', ', 'magzen' ) ); if ( $tags_list ) { printf( ' ' . __( '%1$s ', 'magzen' ) . '', $tags_list ); } } // Edit if ( 'edit' == $edit ) { edit_post_link( __( 'Edit', 'magzen' ), ' ', '' ); } } } endif; /* Header Breaking News */ add_action('magzen_header_breaking_news','magzen_header_breaking_news'); if(! function_exists('magzen_header_breaking_news') ) { function magzen_header_breaking_news() { ?>

Welcome page', 'magzen' ), 'MagZen', admin_url( 'themes.php?page=magzen_upgrade' ) ); ?>