This repository has been archived by the owner on Jul 8, 2018. It is now read-only.
forked from lingz/gazelle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent-single.php
executable file
·142 lines (137 loc) · 5.46 KB
/
content-single.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
<?php
/**
* The default template for displaying content. Used for both single and index/archive/search.
*
* @package WordPress_Themes
* @subpackage Gridlock
*/
?>
<div id="id-<?php the_ID(); ?>" class="article container">
<div class="row row-title">
<div class="col-12">
<h1><?php the_title(); ?></h1>
</div>
</div>
<div class="row row-date">
<div class="col-12">
<h5 class="text-muted"><?php the_date(); ?></h5>
</div>
</div>
<div class="row row-byline <?php echo strtolower(get_cat()); ?>">
<div class="col-12">
<h4 class="text-muted"><?php coauthors_posts_links(", ", " and "); ?></h4>
</div>
</div>
<div class="row row-content">
<div class="col-12">
<?php the_content(); ?>
</div>
</div>
<div class="row row-share">
<div class="col-12">
<div class="fb-like" data-href="<?php echo get_permalink() ?>" data-layout="button_count" data-width="450" data-show-faces="true" data-send="false"></div>
<a href="https://twitter.com/share" class="twitter-share-button" data-via="TheGazelleAD" data-dnt="true">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</div>
</div>
<div class="row row-author">
<div class="author-container">
<div class="image-container">
<?php
$i = new CoAuthorsIterator();
$count = 0;
global $authordata;
$pattern = '/.+src="(.+?)".+/';
while ($i->iterate()) {
$img = mt_profile_img( get_the_author_meta( 'ID' ), array("echo" => false));
if (strlen($img) > 0) {
$parsed = preg_replace($pattern, "$1", $img);
$count++; ?>
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" title="Posts by <?php echo the_author_meta( 'display_name' ); ?>">
<div class="image" style="background-image: url(<?php echo $parsed ?>)"></div>
</a>
<?php
}
}
?>
</div>
<h5 class="bar-divider" style="padding-left: <?php echo (90 * $count + 10) . 'px' ?>"><?php coauthors_posts_links(", ", " and "); ?></h5>
</div>
</div>
<div class="row row-more">
<div class="bar bar-<?php echo strtolower(get_cat()); ?>">
<h5>More in <?php echo get_cat(); ?></h5>
</div>
<div class="scroll-wrap">
<div id="more-scroll">
<div class="scroller">
<ul>
<?php
// other posts
$params = active_issue(array_merge(get_option("gridlock_grid_query"), array('orderby' => 'date', 'order' => 'DESC', "post_status" => "publish", "category_name" => strtolower(get_cat()))));
$current_id = get_the_ID();
$more_query = new WP_Query($params);
while ( $more_query->have_posts() ) : $more_query->the_post(); ?>
<?php if (get_the_ID() != $current_id) {
$image_url = false;
if (has_post_thumbnail()) {
$image_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), array(300, 300), false, '');
$image_url = $image_url[0];
} else {
$image_url = catch_image();
}
?>
<li>
<div class="more-content">
<a href="<?php the_permalink(); ?>" title=<?php the_title(); ?> class="row-article">
<div class="article-image" >
<div class="image" style="background-image: url(<?php echo $image_url ?>)">
<div class="image-overlay overlay-<?php echo strtolower(get_cat()); ?>">
<div class="image-overlay-text">
<h5 class="article-title"> <?php echo strtoupper(get_the_title()); ?> </h5>
<small class="text-muted">
<?php coauthors(", ", " and "); ?>
</small>
</div>
</div>
</div>
</div>
</a>
</div>
</li>
<?php } ?>
<?php endwhile;
remove_filter( 'posts_where', '_exclude_meta_key_in_posts_where' );
?>
</ul>
</div>
<div class="left carousel-control">
<a class="icon-prev"></a>
</div>
<div class="right carousel-control">
<a class="icon-next"></a>
</div>
</div>
</div>
</div>
<div class="row row-trending">
<div class="col-12">
<h5 class="bar-divider">Trending</h5>
<div id="sidebar">
<?php get_sidebar(); ?>
</div>
</div>
</div>
<div class="row row-comments">
<h5 class="bar-divider">Comments</h5>
<?php echo do_shortcode('[fbcomments url="' . home_url( $wp->request ) . '/"]'); ?>
</div>
</div>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=221480151338840";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>