-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathsingle-post-word-count-example.php
171 lines (142 loc) · 6.89 KB
/
single-post-word-count-example.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php
the_post();
get_header();
?>
<!-- s-content
================================================== -->
<section class="s-content s-content--narrow s-content--no-padding-bottom">
<article class="row format-standard">
<div class="s-content__header col-full">
<h1 class="s-content__header-title">
<?php the_title() ?>
</h1>
<ul class="s-content__header-meta">
<li class="date"><?php the_date() ?></li>
<li class="cat">
In
<?php the_category( " " ); ?>
</li>
</ul>
</div> <!-- end s-content__header -->
<div class="s-content__media col-full">
<div class="s-content__post-thumb">
<?php the_post_thumbnail( "large" ); ?>
</div>
</div> <!-- end s-content__media -->
<div class="col-full s-content__main">
<?php
the_content();
$group_metabox_data = get_post_meta( get_the_ID(), 'post_group_data', true );
$group_data = $group_metabox_data['group_field'];
foreach ( $group_data as $gd ) {
echo esc_html( $gd['text_data'] );
echo "<br/>";
echo get_the_title( $gd['select_data'] );
echo "<br/>";
echo wp_get_attachment_image( $gd['image_data'] );
echo "<hr/>";
}
echo esc_html( $group_data[1]['text_data'] );
echo "<br/>";
echo wp_get_attachment_image( $group_data[1]['image_data'] );
echo "<br/>";
echo "<hr/>";
echo "<h2>" . __( 'Group Field From Option Panel', 'philosophy' ) . "</h2>";
$theme_option_group_data = cs_get_option( 'group_field' );
/*echo "<pre>";
print_r( $theme_option_group_data );
echo "<pre>";*/
foreach($theme_option_group_data as $togd){
echo esc_html( $togd['text_data'] );
echo "<br/>";
echo get_the_title( $togd['select_data'] );
echo "<br/>";
echo wp_get_attachment_image( $togd['image_data'] );
echo "<hr/>";
}
echo esc_html( $theme_option_group_data[1]['text_data'] );
echo "<br/>";
echo get_the_title( $theme_option_group_data[1]['select_data'] );
echo "<br/>";
echo wp_get_attachment_image( $theme_option_group_data[1]['image_data'] );
echo "<br/>";
wp_link_pages();
?>
<p class="s-content__tags">
<span>Post Tags</span>
<span class="s-content__tag-list">
<?php
the_tags( "", "", "" );
?>
</span>
</p> <!-- end s-content__tags -->
<div class="s-content__author">
<?php echo get_avatar( get_the_author_meta( "ID" ) ); ?>
<div class="s-content__author-about">
<h4 class="s-content__author-name">
<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ); ?>">
<?php the_author(); ?>
</a>
</h4>
<p>
<?php the_author_meta( "description" ); ?>
</p>
<ul class="s-content__author-social">
<?php
$philosophy_author_facebook = get_field( "facebook", "user_" . get_the_author_meta( "ID" ) );
$philosophy_author_twitter = get_field( "twitter", "user_" . get_the_author_meta( "ID" ) );
$philosophy_author_instagram = get_field( "instagram", "user_" . get_the_author_meta( "ID" ) );
?>
<?php if ( $philosophy_author_facebook ): ?>
<li><a href="<?php echo esc_url( $philosophy_author_facebook ); ?>">Facebook</a></li>
<?php endif; ?>
<?php if ( $philosophy_author_twitter ): ?>
<li><a href="<?php echo esc_url( $philosophy_author_twitter ); ?>">Twitter</a></li>
<?php endif; ?>
<?php if ( $philosophy_author_instagram ): ?>
<li><a href="<?php echo esc_url( $philosophy_author_instagram ); ?>">Instagram</a></li>
<?php endif; ?>
</ul>
</div>
</div>
<div class="s-content__pagenav">
<div class="s-content__nav">
<div class="s-content__prev">
<?php
$philosophy_prev_post = get_previous_post();
if ( $philosophy_prev_post ):
?>
<a href="<?php echo get_the_permalink( $philosophy_prev_post ); ?>" rel="prev">
<span><?php _e( "Previous Post", "philosophy" ); ?></span>
<?php echo get_the_title( $philosophy_prev_post ); ?>
</a>
<?php
endif;
?>
</div>
<div class="s-content__next">
<?php
$philosophy_next_post = get_next_post();
if ( $philosophy_next_post ):
?>
<a href="<?php echo get_the_permalink( $philosophy_next_post ); ?>" rel="next">
<span><?php _e( "Next Post", "philosophy" ); ?></span>
<?php echo get_the_title( $philosophy_next_post ); ?>
</a>
<?php
endif;
?>
</div>
</div>
</div> <!-- end s-content__pagenav -->
</div> <!-- end s-content__main -->
</article>
<!-- comments
================================================== -->
<?php
if ( ! post_password_required() ) {
comments_template();
}
?>
</section> <!-- s-content -->
<?php get_footer(); ?>