/
page-topp-posts.php
executable file
·113 lines (76 loc) · 2.92 KB
/
page-topp-posts.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
<?php
/*
* Template Name: Topp Posts
*/
get_header(); ?>
<div class="main spread">
<?php get_template_part( 'content', 'sidebar-topp_posts' ); ?>
<?php
$args = array(
'post_type' => 'post',
'posts_per_page' => 1
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) : ?>
<div class="span8">
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="topp-post-content">
<h1><?php the_title(); ?></h1>
<?php if ( has_post_thumbnail() ) { ?>
<div class="topp-post-image">
<?php the_post_thumbnail( 'topp-link-post' ); ?>
</div>
<?php }; ?>
<div class="topp-post-the_content">
<?php the_content(); ?>
</div>
<section class="comments">
<h4><a href="#disqus-target">Add A Comment</a> <a href="<?php the_permalink(); ?>#disqus_thread"></a></h4>
<div class="social">
<?php
$jsps_networks = array( 'facebook', 'twitter' );
juiz_sps( $jsps_networks );
$imgUrl = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
$current_url = home_url(add_query_arg(array(),$wp->request));
?>
<div class="juiz_sps_links counters_both juiz_sps_displayed_nowhere">
<ul class="juiz_sps_links_list">
<li class="juiz_sps_item juiz_sps_link_pinterest">
<a href="http://www.pinterest.com/pin/create/button/?url=<?php echo $current_url; ?>&media=<?php echo $imgUrl; ?>&description=<?php echo str_replace(' ', '%20', the_title('', '', false)); ?>%20%007C%20View%20From%20the%20Topp" target="_blank">
<span class="juiz_sps_icon"></span>
<span class="juiz_sps_network_name">Pinterest</span>
</a>
</li>
</ul>
</div>
</div>
</section>
<section class="tags">
<h4>Tags</h4>
<span><?php the_tags( ' ', ', ', '' ); ?></span>
</section>
<span class="target-fix" id="disqus-target"></span>
<section id="disqus">
<div class="disqus-comments">
<?php comments_template(); ?>
</div>
</section>
</div>
<?php endwhile;
// Pagination Here
wp_reset_postdata(); ?>
</div>
<?php endif; ?>
</div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'vftt'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function () {
var s = document.createElement('script'); s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
<?php get_footer();