-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle-custom_type.php
122 lines (100 loc) · 4.09 KB
/
single-custom_type.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php
/*
* CUSTOM POST TYPE TEMPLATE
*
* This is the custom post type post template. If you edit the post type name, you've got
* to change the name of this template to reflect that name change.
*
* For Example, if your custom post type is "register_post_type( 'bookmarks')",
* then your single template should be single-bookmarks.php
*
* Be aware that you should rename 'custom_cat' and 'custom_tag' to the appropiate custom
* category and taxonomy slugs, or this template will not finish to load properly.
*
* For more info: http://codex.wordpress.org/Post_Type_Templates
*/
get_header();
?>
<main id="main" class="content-wrap cf" role="main" itemscope itemprop="mainContentOfPage" itemtype="http://schema.org/Blog">
<?php
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'article-layout cf' ); ?> role="article" itemscope itemprop="blogPost" itemtype="http://schema.org/BlogPosting">
<header class="article-header">
<?php grammatizator_post_thumbnail( 'gramm-feature' ); ?>
<div class="category-titles">
<?php the_category( ', ' ); ?>
</div>
<h2 class="entry-title single-title h1" itemprop="headline" rel="bookmark"><?php the_title(); ?></h2>
<p class="entry-details entry-meta">
<?php
/* translators: 1: the author page URL, 2: main author name, 3: potential additional author names, 4: the post publish time in Y-m-d format, 5: the post publish time in default format */
printf( __( '<span class="amp">By</span> <a href="%1$s" class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">%2$s</a> %3$s • <time class="pubdate updated entry-time" datetime="%4$s" itemprop="datePublished">%5$s</time>', 'bonestheme' ), // wpcs: XSS ok.
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_html( get_the_author_meta( 'display_name' ) ),
gramm_has_multiple_authors(),
esc_attr( get_the_time( 'Y-m-d' ) ),
esc_html( get_the_time( get_option( 'date_format' ) ) )
);
?>
</p>
<div class="sharing-container">
<p>Sharing</p>
<?php
if ( function_exists( 'sharing_display' ) ) {
sharing_display( '', true );
}
?>
</div>
</header>
<section class="article-content entry-content cf" itemprop="articleBody">
<?php the_content(); ?>
</section>
<aside class="article-supplement">
<?php grammatizator_post_thumbnail_caption(); ?>
<?php the_tags( '<p class="tag-titles"><span>' . __( 'Tags:', 'bonestheme' ) . '</span> ', ', ', '</p>' ); ?>
</aside>
<footer class="article-footer">
<h4>About the Author</h4>
<?php // @todo Move this to /library/inc/template-tags.php
$multiauthor_values = get_post_custom_values( 'Additional author username' );
if ( ! $multiauthor_values ) {
gramm_list_authors( 'include=' . get_the_author_meta( 'ID' ) . '&layout=byline&heading_tag=h5&show_grammtitle=0&avatarsize=128' );
} else {
// First create array with standard post author ID
$authors = get_the_author_meta( 'ID' );
// Now loop through custom meta values
foreach ( $multiauthor_values as $key => $value ) {
// Get each additional author's metadata
$addauthor = get_user_by( 'login', $value );
// Push additional author's user ID to the array
$authors .= ', ' . $addauthor->ID;
}
// Feed array to custom list authors function
gramm_list_authors( 'include=' . $authors . '&layout=byline&heading_tag=h5&show_grammtitle=0&avatarsize=128' );
}
?>
</footer>
<?php comments_template(); ?>
</article>
<?php
endwhile;
else :
?>
<article id="post-not-found" class="hentry cf">
<header class="article-header">
<h1><?php esc_html_e( 'Oops, Post Not Found!', 'bonestheme' ); ?></h1>
</header>
<section class="entry-content">
<p><?php esc_html_e( 'Uh Oh. Something is missing. Try double checking things.', 'bonestheme' ); ?></p>
</section>
</article>
<?php
endif;
get_sidebar();
?>
</main>
<?php
get_footer();