Commit 3c11da19 authored by numeroteca's avatar numeroteca

#12 añade loop de proeyctos asociados a la página de proyectos

parent 21fb3350
......@@ -24,70 +24,100 @@ get_header(); ?>
<div id="content" class="clearfix">
<?php // ---------------------
// Loop through proyectos
if ( is_page( 'Residencias' ) || is_page( 'Egonaldiak' ) ) { // if page is Residencias
$args = array(
'post_type' => 'pr', //sets post type to "Project"
'order' => 'DESC',
'posts_per_page'=> -1,
'tax_query' => array(
array(
'taxonomy' => 'tp-pr',
'field' => 'slug',
'terms' => 'residencia',
)
)
);
} else { // if page is Proyectos
$args_active = array(
'post_type' => 'pr', //sets post type to "Project"
'order' => 'DESC',
'posts_per_page'=> -1,
'tax_query' => array(
array(
'taxonomy' => 'es-pr',
'field' => 'slug',
'terms' => 'activo',
)
)
);
$args = $args_active;
$args_archive = array(
'post_type' => 'pr', //sets post type to "Project"
'order' => 'DESC',
'posts_per_page'=> -1,
'tax_query' => array(
array(
'taxonomy' => 'es-pr',
'field' => 'slug',
'terms' => 'archivado',
)
)
);
}
if ( $paged > 1 ) {
$args['paged'] = $paged;
}
$my_query = new WP_Query($args);
$wp_count = $my_query->post_count; //The number of posts being displayed
$my_query_archive = new WP_Query($args_archive);
//----------------------- ?>
<?php global $post_i; $post_i = 1; ?>
<?php if ($my_query->have_posts() ) : while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
<?php get_template_part( 'content', 'archive' ); ?>
<?php endwhile; endif; ?>
<?php // ---------------------
// Loop through proyectos
if ( is_page( 'Residencias' ) || is_page( 'Egonaldiak' ) ) { // if page is Residencias
$args = array(
'post_type' => 'pr', //sets post type to "Project"
'order' => 'DESC',
'posts_per_page'=> -1,
'tax_query' => array(
array(
'taxonomy' => 'tp-pr',
'field' => 'slug',
'terms' => 'residencia',
)
)
);
} else { // if page is Proyectos
// Active projects
$args_active = array(
'post_type' => 'pr', //sets post type to "Project"
'order' => 'DESC',
'posts_per_page'=> -1,
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'es-pr',
'field' => 'slug',
'terms' => 'activo',
),
array(
'taxonomy' => 'tp-pr',
'field' => 'slug',
'terms' => 'de-wikitoki',
)
)
);
$args = $args_active;
// Past projects
$args_archive = array(
'post_type' => 'pr', //sets post type to "Project"
'order' => 'DESC',
'posts_per_page'=> -1,
'tax_query' => array(
array(
'taxonomy' => 'es-pr',
'field' => 'slug',
'terms' => 'archivado',
)
)
);
// Asociados projects
$args_asociados = array(
'post_type' => 'pr', //sets post type to "Project"
'order' => 'DESC',
'posts_per_page'=> -1,
'tax_query' => array(
array(
'taxonomy' => 'tp-pr',
'field' => 'slug',
'terms' => 'asociados',
)
)
);
}
?>
<h2 id="activos" style="clear:both;"><?php echo _e("Proyectos activos","colormag-child"); ?></h2>
<div class="list_duo">
<?php
// Loop through all the $args projects
if ( $paged > 1 ) {
$args['paged'] = $paged;
}
$my_query = new WP_Query($args);
$wp_count = $my_query->post_count; //The number of posts being displayed
$my_query_archive = new WP_Query($args_archive);
$my_query_asociados = new WP_Query($args_asociados);
global $post_i; $post_i = 1;
if ($my_query->have_posts() ) : while ( $my_query->have_posts() ) : $my_query->the_post();
get_template_part( 'content', 'archive' );
endwhile; endif; ?>
</div>
<?php
// List all the residencias projects by year
......@@ -96,8 +126,11 @@ get_header(); ?>
// Gets every "category" (term) in this taxonomy to get the respective posts
$terms = get_terms( "yr" );
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(
......@@ -127,17 +160,33 @@ get_header(); ?>
endforeach;
} else { // if is page Proyectos
} else { // if is page Proyectos (as this templte is not used else where)
?>
<h2 id="asociados" style="clear:both;"><?php echo _e("Proyectos asociados","colormag-child"); ?></h2>
<div class="list_duo">
<h2 style="clear:both;"><?php echo _e("Proyectos archivados","colormag-child"); ?></h2>
<?php if ($my_query_archive->have_posts() ) : while ( $my_query_archive->have_posts() ) : $my_query_archive->the_post(); ?>
<?php if ($my_query_asociados->have_posts() ) : while ( $my_query_asociados->have_posts() ) : $my_query_asociados->the_post(); ?>
<?php get_template_part( 'content', 'archive' ); ?>
<?php get_template_part( 'content', 'archive' ); ?>
<?php endwhile; endif; ?>
<?php endwhile; endif; ?>
</div>
<h2 id="archivados" style="clear:both;"><?php echo _e("Proyectos archivados","colormag-child"); ?></h2>
<div class="list_duo">
<?php if ($my_query_archive->have_posts() ) : while ( $my_query_archive->have_posts() ) : $my_query_archive->the_post(); ?>
<?php get_template_part( 'content', 'archive' ); ?>
<?php endwhile; endif; ?>
</div>
<?php
}
......
......@@ -53,7 +53,7 @@ body.entidad-template-default #content article.entidad {
}
*/
#content .post:nth-child(2n),
#content .pr:nth-child(2n),
.list_duo .pr:nth-child(2n),
#futuro .actividad:nth-child(even),
#pasado .actividad:nth-child(even) {
float: right;
......@@ -61,7 +61,7 @@ body.entidad-template-default #content article.entidad {
clear: none;
}
#content .post:nth-child(2n+1),
#content .pr:nth-child(2n+1),
.list_duo .pr:nth-child(2n+1),
#content .actividad:nth-child(2n+1),
#futuro .actividad:nth-child(odd),
#pasado .actividad:nth-child(odd) {
......@@ -70,7 +70,7 @@ body.entidad-template-default #content article.entidad {
}
#content .post:nth-child(odd),
#content .pr:nth-child(odd),
.list_duo .pr:nth-child(odd),
#content .actividad:nth-child(odd),
#futuro .actividad:nth-child(odd),
#pasado .actividad:nth-child(odd)
......@@ -138,16 +138,16 @@ body.entidad-template-default #content article.entidad {
/* Basic h sizes */
h1 {
font-size:42px;
font-size:42px !important;
}
h2 {
font-size:34px;
font-size:34px !important;
}
h3 {
font-size:30px;
font-size:30px !important;
}
h4 {
font-size:26px;
font-size:26px !important;
}
/* Header logo */
......
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