Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Prints HTML with meta information for the current post-date/time and author.
- *
- * @return string
- */
- if ( ! function_exists( 'jas_gecko_posted_on' ) ) {
- function jas_gecko_posted_on() {
- $output = '';
- $time = '<a class="cg" href="%3$s"><time class="entry-date published updated" datetime="%1$s" ' . jas_gecko_schema_metadata( array( 'context' => 'entry_time', 'echo' => false ) ) . '>%2$s</time></a>';
- $output .= sprintf( $time,
- esc_attr( get_the_date( 'c' ) ),
- esc_html( get_the_date() ),
- esc_url( get_permalink() )
- );
- echo apply_filters( 'jas_gecko_posted_on', '<span class="posted-on fs__12">' . $output . '</span>' );
- }
- }
- /**
- * Prints post title.
- *
- * @return string
- */
- if ( ! function_exists( 'jas_gecko_post_title' ) ) {
- function jas_gecko_post_title( $link = true ) {
- $output = '';
- if ( $link ) {
- $output .= sprintf( '<h2 class="post-title fs__14 ls__2 mt__10 mb__5 tu" ' . jas_gecko_schema_metadata( array( 'context' => 'entry_title', 'echo' => false ) ) . '><a class="chp" href="%2$s" rel="bookmark">%1$s</a></h2>', get_the_title(), esc_url( get_permalink() ) );
- } else {
- $output .= sprintf( '<h2 class="post-title fs__14 ls__2 tu" ' . jas_gecko_schema_metadata( array( 'context' => 'entry_title', 'echo' => false ) ) . '>%s</h2>', get_the_title() );
- }
- echo apply_filters( 'jas_gecko_post_title', $output );
- }
- }
- /**
- * Prints post meta with the post author, categories and post comments.
- *
- * @return string
- */
- if ( ! function_exists( 'jas_gecko_post_meta' ) ) {
- function jas_gecko_post_meta() {
- $output = '';
- // Post author
- $output .= sprintf(
- esc_html__( '%1$s', 'gecko' ),
- '<span class="author vcard pr" ' . jas_gecko_schema_metadata( array( 'context' => 'author', 'echo' => false ) ) . '>' . esc_html__( 'By ', 'gecko' ) . '<a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
- );
- // Post categories
- $categories = get_the_category_list( esc_html__( ', ', 'gecko' ) );
- if ( $categories ) {
- $output .= sprintf(
- '<span class="cat pr">' . esc_html__( 'In %1$s', 'gecko' ) . '</span>', $categories
- );
- }
- // Post comments
- if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
- $output .= sprintf( '<span class="comment-number pr"><a href="%2$s">' . esc_html__( '%1$s Comment', get_comments_number(), 'gecko' ) . '</a></span>', number_format_i18n( get_comments_number() ), get_comments_link() );
- }
- echo apply_filters( 'jas_gecko_post_meta', '<div class="post-meta fs__12">' . $output . '</div>' );
- }
- }
- /**
- * Render post tags.
- *
- * @since 1.0.0
- */
- if ( ! function_exists( 'jas_gecko_get_tags' ) ) :
- function jas_gecko_get_tags() {
- $output = '';
- // Get the tag list
- $tags_list = get_the_tag_list( '', esc_html__( ', ', 'gecko' ) );
- if ( $tags_list ) {
- $output .= sprintf( '<div class="post-tags"><i class="fa fa-tags"></i> ' . esc_html__( '%1$s', 'gecko' ) . '</div>', $tags_list );
- }
- return apply_filters( 'jas_gecko_get_tags', $output );
- }
- endif;
- /**
- * Display an optional post thumbnail.
- *
- * Wraps the post thumbnail in an anchor element on index views, or a div
- * element when on single views.
- *
- * @return string
- */
- if ( ! function_exists( 'jas_gecko_post_thumbnail' ) ) {
- function jas_gecko_post_thumbnail() {
- if ( post_password_required() || is_attachment() ) {
- return;
- }
- ?>
- <div class="post-thumbnail pr mb__25">
- <?php if ( has_post_thumbnail() ) : ?>
- <a href="<?php esc_url( the_permalink() ); ?>" aria-hidden="true">
- <?php the_post_thumbnail( 'post-thumbnail', array( 'alt' => get_the_title() ) ); ?>
- </a>
- <?php endif; ?>
- <div class="pa inside-thumb tc cg">
- <?php jas_gecko_post_meta(); ?>
- <?php jas_gecko_post_title(); ?>
- <?php jas_gecko_posted_on(); ?>
- </div>
- </div>
- <?php
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement