Commit 4d3469cc authored by numeroteca's avatar numeroteca

#8 residencias en grande activas y archivadas ahora van en pequeño por año

parent 589daede
......@@ -32,11 +32,17 @@ get_header(); ?>
'order' => 'DESC',
'posts_per_page'=> -1,
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'tp-pr',
'field' => 'slug',
'terms' => 'residencia',
)
'terms' => 'residencia', // es residencia
),
array(
'taxonomy' => 'es-pr',
'field' => 'slug',
'terms' => 'activo', // está en activo
),
)
);
} else { // if page is Proyectos
......@@ -51,12 +57,12 @@ get_header(); ?>
array(
'taxonomy' => 'es-pr',
'field' => 'slug',
'terms' => 'activo',
'terms' => 'activo', // está en activo
),
array(
'taxonomy' => 'tp-pr',
'field' => 'slug',
'terms' => 'de-wikitoki',
'terms' => 'de-wikitoki', // es de Wikitoki
)
)
);
......@@ -93,7 +99,22 @@ get_header(); ?>
}
?>
<h2 id="activos" class="subsection"><span><?php echo _e("Proyectos activos","colormag-child"); ?></span></h2>
<?php
if ( is_page( 'Residencias' ) || is_page( 'Egonaldiak' ) ) { // if page is Residencias
?>
<h2 id="activos" class="subsection"><span><?php echo _e("Residencias activas","colormag-child"); ?></span></h2>
<?php
} else { // if page is Proyectos
?>
<h2 id="activos" class="subsection"><span><?php echo _e("Proyectos activos","colormag-child"); ?></span></h2>
<?php
}
?>
<div class="list_duo">
......@@ -130,37 +151,59 @@ get_header(); ?>
if ( is_page( 'Residencias' ) || is_page( 'Egonaldiak' ) ) { // Only for Residencias
echo '<hr style="clear:both;">';
foreach( $terms as $term ) :
echo "<h3>".$term->slug."</h3>";
$args = array(
'post_type' => 'pr', //sets post type to "Project"
'order' => 'DESC',
'posts_per_page'=> -1,
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'yr',
'field' => 'slug',
'terms' => $term->slug
),
array(
'taxonomy' => 'tp-pr',
'field' => 'slug',
'terms' => 'residencia',
),
),
);
$posts = new WP_Query( $args );
if( $posts->have_posts() ): while( $posts->have_posts() ) : $posts->the_post();
//echo get_the_title()."<br>";
the_title( '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a><br>' );
endwhile; endif;
endforeach;
?>
<h2 id="archivo" class="subsection"><span><?php echo _e("Archivo de residencias","colormag-child"); ?></span></h2>
<div class="widget widget_featured_posts widget_featured_posts_vertical widget_featured_meta clearfix">
<div class="following-post">
<?php
foreach( $terms as $term ) :
echo "<h3>".$term->slug."</h3>";
$args = array(
'post_type' => 'pr', //sets post type to "Project"
'order' => 'DESC',
'posts_per_page'=> -1,
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'yr',
'field' => 'slug',
'terms' => $term->slug
),
array(
'taxonomy' => 'tp-pr',
'field' => 'slug',
'terms' => 'residencia',
),
),
);
$posts = new WP_Query( $args );
if( $posts->have_posts() ): while( $posts->have_posts() ) : $posts->the_post();
//echo get_the_title()."<br>";
//the_title( '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a><br>' );
get_template_part( 'content', 'actividadbox' );
endwhile; endif;
endforeach;
?>
</div>
</div>
<?php
} else { // if is page Proyectos (as this templte is not used else where)
?>
<h2 id="asociados" class="subsection"><span><?php echo _e("Proyectos asociados","colormag-child"); ?></span></h2>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment