Created
September 5, 2016 06:23
-
-
Save SirDarcanos/68aad7c318a9ca7e0fe7f9b8585fee6d to your computer and use it in GitHub Desktop.
Link post format template for Storefront
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> | |
<header class="entry-header"> | |
<?php | |
$original_url = get_post_meta( get_the_id(), '_wpcom-crosspost-original_url', true ); | |
$url = ! empty( $original_url ) ? $original_url : get_permalink(); | |
if ( is_single() ) { | |
storefront_posted_on(); | |
?> | |
<span class="posted-on"><?php printf( __( 'at <a href="%s" rel="bookmark">%s</a>', 'storefront' ), esc_url( $url ), parse_url( $url, PHP_URL_HOST ) ); ?></span> | |
<?php | |
the_title( '<h1 class="entry-title">', '</h1>' ); | |
} else { | |
if ( 'post' == get_post_type() ) { | |
storefront_posted_on(); | |
?> | |
<span class="posted-on"><?php printf( __( 'at <a href="%s" rel="bookmark">%s</a>', 'storefront' ), esc_url( $url ), parse_url( $url, PHP_URL_HOST ) ); ?></span> | |
<?php | |
} | |
the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( $url ) ), '</a></h1>' ); | |
} | |
?> | |
</header><!-- .entry-header --> | |
<div class="entry-meta"> | |
<?php | |
echo '<label class="label">' . esc_attr( __( 'Written by', 'storefront' ) ) . '</label>'; | |
the_author_posts_link(); | |
/* translators: used between list items, there is a space after the comma */ | |
$categories_list = get_the_category_list( __( ', ', 'storefront' ) ); | |
if ( $categories_list ) : | |
echo '<label class="label"> - ' . esc_attr( __( 'Posted in', 'storefront' ) ) . '</label>'; | |
echo wp_kses_post( $categories_list ); | |
endif; // End if categories. | |
/* translators: used between list items, there is a space after the comma */ | |
$tags_list = get_the_tag_list( '', __( ', ', 'storefront' ) ); | |
if ( $tags_list ) : | |
echo '<label class="label"> - ' . esc_attr( __( 'Tagged', 'storefront' ) ) . '</label>'; | |
echo wp_kses_post( $tags_list ); | |
endif; // End if $tags_list. ?> | |
</div> | |
</article><!-- #post-## --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment