-
Notifications
You must be signed in to change notification settings - Fork 1
/
single.php
94 lines (93 loc) · 3.98 KB
/
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
<?php get_header(); ?>
<section class="content">
<div class="container">
<div class="row">
<div id="articulos" class="col-md-7">
<?php if( have_posts() ) : while( have_posts() ) : the_post(); ?>
<article <?php post_class(); ?>>
<?php
$cont=0;
foreach((get_the_category()) as $category) {
if ($cont == 0) {
$firstCat = $category->cat_name;
}
$cont++;
}
?>
<div class="row">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- trolling-custom -->
<ins class="adsbygoogle"
style="display:inline-block;width:600px;height:100px"
data-ad-client="ca-pub-3620678877337408"
data-ad-slot="7035407576"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
<div class="row">
<div class="titlePost col-md-9"><h2><?php echo "#".$firstCat." | "; the_title(); ?></h2></div>
<div class="col-md-3 votes text-right"><?php if(function_exists('wp_ulike')) wp_ulike('get'); ?></div>
</div>
<div class="row contentImage">
<img class="imgArticle img-responsive" src="<?php echo wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ); ?>" alt="<?php echo the_title(); ?>">
</div>
<div class="row tags">
<h4><?php $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { echo '<span class="label label-info">#'.$tag->name . '</Span> '; } } ?></h4>
</div>
<div class="row textArticle">
<?php the_content(); ?>
</div>
<div class="row">
<?php
if ( function_exists( 'sharing_display' ) ) {
sharing_display( '', true );
}
if ( class_exists( 'Jetpack_Likes' ) ) {
$custom_likes = new Jetpack_Likes;
echo $custom_likes->post_likes( '' );
}
?>
</div>
<div class="row infoAuthor">
<div class="col-xs-1 avatar">
<?php //echo get_avatar( get_the_author_meta('email') , 65 ); ?>
<?php
$str = get_avatar( get_the_author_meta('email') , 65 );
preg_match('/(src=["\'](.*?)["\'])/', $str, $match); //find src="X" or src='X'
$split = preg_split('/["\']/', $match[0]); // split by quotes
$url_avatar = $split[1]; // X between quotes
?>
<img class="img-circle" src="<?php echo $url_avatar; ?>">
</div>
<div class="col-xs-4 author">By: <em><?php the_author_meta('display_name') ?></em></div>
<div class="readMore col-xs-7 text-right">
<?php
$next = get_permalink(get_adjacent_post(false,'',false));
$prev = get_permalink(get_adjacent_post(false,'',true));
if ($prev != get_permalink()) {
?>
<a href="<?php echo $prev; ?>" class="btn btn-default btn-md">
<span class="glyphicon glyphicon-chevron-left"></span>Previous
</a>
<?php }
if ($next != get_permalink()) {
?>
<a href="<?php echo $next; ?>" class="btn btn-default btn-md">
<span class="glyphicon glyphicon-chevron-right"></span>Next
</a>
<?php } ?>
</div>
</div>
<hr>
</article>
<section class="coments">
<?php comments_template(); ?>
</section>
<?php endwhile; endif; ?>
</div>
<?php get_sidebar('blog'); ?>
</div>
</div>
</section>
<?php get_footer(); ?>