Commit 641518b8 authored by numeroteca's avatar numeroteca

#4 crea página de inicio con actividades, posts y proyectos activos

parent 8bdf4f1a
<?php
/* Template Name: Home page */
get_header(); ?>
<?php do_action( 'colormag_before_body_content' ); ?>
<div id="primary_home">
<div id="content2" class="clearfix">
<?php
// Display Actividades -----------------------
$args = array(
'post_type' => 'actividad', //sets post type to actividad
'meta_key' => '_act_date-init',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'posts_per_page'=> 2,
);
if ( $paged > 1 ) {
$args['paged'] = $paged;
}
$my_query = new WP_Query($args);
?>
<?php echo "<h2 class='subsection'><span>".__('Next Activities','colormag-child')."</span></h2>"; ?>
<div id="futuro">
<?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; ?>
</div>
</div><!-- #content2 -->
<?php // Display News ----------------------- ?>
<h2 id="noticias" class="subsection"><span><?php echo _e("Blog ","colormag-child"); ?></span></h2>
<div id="content" class="clearfix">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', '' ); ?>
<?php endwhile; ?>
<?php get_template_part( 'navigation', 'none' ); ?>
<?php else : ?>
<?php get_template_part( 'no-results', 'none' ); ?>
<?php endif; ?>
</div><!-- #content -->
<div id="content3" class="clearfix">
<?php // Display 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', // está en activo
),
array(
'taxonomy' => 'tp-pr',
'field' => 'slug',
'terms' => 'wikitoki', // es de Wikitoki
)
)
);
$args = $args_active;
?>
<h2 id="activos" class="subsection"><span><?php echo _e("Active projects","colormag-child"); ?></span></h2>
<div class="list_duo">
<?php
// Loop through all the $args projects
if ( $paged > 1 ) {
$args['paged'] = $paged;
}
$my_query = new WP_Query($args);
$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>
</div><!-- #content3 -->
</div><!-- #primary -->
<?php colormag_sidebar_select(); ?>
<?php do_action( 'colormag_after_body_content' ); ?>
<?php get_footer(); ?>
......@@ -43,6 +43,13 @@ body.entidad-template-default #content article.entidad {
width:100%;
}
/* home */
#primary_home {
width: 70.17543859%;
float: none;
margin: 0 auto;
}
/* Add features for Projects and Activities */
/* We add the behaviour for our own custom post types */
......@@ -169,7 +176,7 @@ h2.subsection span {
/* Responsiveness. For smalll screens */
@media only screen and (max-width: 600px) {
#content .post, #content .pr, .tax-yr #content .pr, .tax-tp-pr #content .pr {
#content .post, #content .pr, .tax-yr #content .pr, .tax-tp-pr #content .pr, #primary_home .pr {
float: none;
width: 100% !important;
}
......@@ -205,6 +212,14 @@ h2.subsection span {
.menu-item-4597, .menu-item-4598 {
display:none !important;
}
#primary_home {
width: 100%;
}
#primary_home .actividad, #futuro .actividad {
width: 100% !important;
}
}
#content .quienes .entidad:nth-child(3n+1) {
......
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