-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-relacionadas.php
executable file
·154 lines (147 loc) · 6.39 KB
/
page-relacionadas.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
<?php get_header(); ?>
<script src='<?php bloginfo('template_url')?>/js/jquery.min-1.7.1.js' type='text/javascript'></script>
<script type="text/javascript">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
<script type='text/javascript'>
//<![CDATA[
// Botón para Ir Arriba
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery("#IrArriba").hide();
jQuery(function () {
jQuery(window).scroll(function () {
if (jQuery(this).scrollTop() > 1000) {
jQuery('#IrArriba').fadeIn();
} else {
jQuery('#IrArriba').fadeOut();
}
});
jQuery('#IrArriba a').click(function () {
jQuery('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
});
});
//]]>
</script>
<div id="content-list" class="container blog-contenedor">
<div class="tituloSingleArea">
<h2><?php the_title(); ?></h2>
</div>
<div class="back-img"></div>
<?php
if ( is_active_sidebar( 'buscador-widget-area' ) ) : ?>
<div class="searchHeaderArea col-md-12 col-lg-12">
<?php //print obtenFechaEspaniol(); ?>
<?php dynamic_sidebar( 'buscador-widget-area' ); ?>
</div>
<?php endif;
wp_reset_query();
$tags = wp_get_post_tags($_GET['id']);
if ($tags) {
$tag_ids = array();
foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
if(!empty($_GET['id']) && !empty($_GET['cat'])){
$args=array(
'tag__in' => $tag_ids,
'post__not_in' => array($_GET['id']),
'posts_per_page'=>-1, // Number of related posts to display.
'caller_get_posts'=>1,
'category_name' => $_GET['cat']
);
}else{
$args=array(
'tag__in' => $tag_ids,
'post__not_in' => array($_GET['id']),
'posts_per_page'=>-1, // Number of related posts to display.
'caller_get_posts'=>1,
);
}
$search = new WP_QUERY( $args );
?>
<div class="back-img"></div>
<?php
if ( $search->have_posts() ) {
?>
<div id="content-nota">
<?php
$cont=1;
while ( $search->have_posts() ) { $search->the_post();
//$category = get_the_category(the_ID());
///echo $category[0]->cat_name;
//print_r ($category);
?>
<div class="divNotaListado col-md-4 col-lg-4 item-nota" style="margin-bottom:3%;">
<div class="contenedorNota">
<?php
$domsxe = simplexml_load_string(get_the_post_thumbnail($post->ID, 'big'));
$thumbnailsrc = "";
if (!empty($domsxe)) {
$thumbnailsrc = $domsxe->attributes()->src;
} else {
$urlTema = get_bloginfo('template_url');
$thumbnailsrc = substr($urlTema, strrpos($urlTema, "/wp-") , strlen($urlTema)) . "/images/imgDefault.png";
}
if (!empty($thumbnailsrc)): ?>
<span class='img img-responsive'>
<div class="pretty-img">
<?php $category = get_cat_slug_by_id($notas->post->ID); ?>
<a class="over-<?php echo $category ?>" data-id="<?php echo $notas->post->ID ?>">
<div class="overlay-<?php echo $category ?>"></div>
<img class="img-responsive" src='<?php bloginfo('template_url') ?>/timthumb.php?src=<?php print $urlTb; ?><?php print $thumbnailsrc; ?>&w=380&h=200' border=0 />
</a>
<div class="post-date">
<?php the_time( 'j M' ); ?>
</div>
</div>
</span>
<?php endif; ?>
<div class="tituloShare">
<div class="link-noticia">
<a class="title" href="<?php the_permalink() ?>" title="Continuar leyendo <?php the_title() ?>" style="text-decoration:none;">
<?php
$textoCortar=get_the_title();
echo myTruncate($textoCortar, 65, ' ', '…');
///echo $category[0]->cat_name;
//print_r ($category);
?>
</a>
</div>
<div class="listadoShareItem">
<!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style addthis_32x32_style move-left">
<span><a class="addthis_button_facebook iconFacebookBlog"></a></span>
<span><a class="addthis_button_twitter iconTwitterBlog"></a></span>
<span><a class="addthis_button_linkedin iconLinkedIn"></a></span>
<span><a class="addthis_button_pinterest_share iconPinterestBlog"></a></span>
<span><a class="addthis_button_google_plusone_share iconPlusBlog"></a></span>
</div>
<script type="text/javascript">var addthis_config = {"data_track_addressbar":false};</script>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-50bb6a904ee20c54"></script>
<!-- AddThis Button END -->
</div>
</div>
</div><!-- end .contenedorNota -->
</div><!-- Fin del div featured clearfix -->
<?php } ?>
<?php }?>
</div>
</div>
<?php if ( $search->max_num_pages > 1 ) : ?>
<div id="nav-below" class="navigation" style="display:none;">
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
</div> <!-- #nav-below -->
<?php endif; ?>
<!--<center><?php if (function_exists('wp_pagenavi')){ wp_pagenavi(); } ?></center> -->
</div>
<?php } ?>
<div id='IrArriba'>
<a href='#Arriba'><span/></a>
</div>
<?php get_footer(); ?>