forked from simgia/cartochaco-wptheme
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
executable file
·68 lines (63 loc) · 2.82 KB
/
index.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
<?php get_header(); ?>
<?php
if(is_front_page()) {
$options = jeo_get_options();
if(!$options || (isset($options['front_page']) && $options['front_page']['front_page_map'] == 'latest'))
jeo_featured();
else
get_template_part('content', 'featured');
} else {
jeo_featured();
}
?>
<div class="section-title">
<div class="container">
<div class="twelve columns">
<!--
Aparece solo una noticia principal (featured post), que se puede agregar por cada post.
Solo va a aparecer el ultimo featured post. La informacion qu se va a mostrar es un extract de la noticia.
-->
<?php query_posts(array('meta_key' => 'featured', 'posts_per_page' => 1, 'showposts' => 1)); if(have_posts()) : ?>
<?php while(have_posts()) : the_post(); ?>
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<div class="intro clearfix">
<?php
$v_content = get_the_excerpt();
$v_palabras = explode(" ", $v_content);
$v_columna_izquierda = "";
$v_columna_derecha = "";
$v_cantidad_palabras = count($v_palabras);
$v_columna_palabra = (int)($v_cantidad_palabras / 2); // El 2 es el # de columnas que se va a mostrar.
for($i = 0; $i < $v_cantidad_palabras; $i++){
if($i < $v_columna_palabra){
$v_columna_izquierda = $v_columna_izquierda . $v_palabras[$i]." ";
}else{
$v_columna_derecha = $v_columna_derecha . $v_palabras[$i]." ";
}
}
?>
<div class="left">
<?php echo $v_columna_izquierda; ?>
</div>
<div class="right">
<?php echo $v_columna_derecha; ?>
</div>
</div>
<?php endwhile; ?>
<?php endif; wp_reset_query(); ?>
</div>
</div>
</div>
<div class="container">
<div class="twelve columns">
<?php get_template_part('section', 'subheader'); ?>
</div>
</div>
<?php
if(get_query_var('cartochaco_advanced_nav')){
get_template_part('loop','explore');
}else{
get_template_part('loop');
}
?>
<?php get_footer(); ?>