Commit 31b7a04b authored by numeroteca's avatar numeroteca

remove listed people if no people is provided in Entidad

parent 77aa6b7a
......@@ -97,43 +97,47 @@ $entity_type_simple = $entity_type[0]->slug;
</dl>
<?php
if ( "colectivo" == $entity_type_simple ) { //tipo de entidad colectiva
echo '<h2>Personas que pertenecen a '. $tit .'</h2>';
} else { //tipo de entidad individual "individual" == $entity_type
echo '<h2>Organizaciones a las que pertenece '. $tit .'</h2>';
}
if ($pertenece_id) {
?>
if ( "colectivo" == $entity_type_simple ) { //tipo de entidad colectiva
<!-- The Loop of entidades-->
<div class="quienes">
<?php
$args = array(
'post_type' => 'entidad', //sets post type to "entidad"
'order' => 'DESC',
'posts_per_page'=> -1,
'post__in' => $pertenece_id, //id de la entidad a la que pertenece
);
echo '<h2>Personas que pertenecen a '. $tit .'</h2>';
$my_query = new WP_Query($args);
$wp_count = $my_query->post_count;
if ($my_query->have_posts() ) : while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
} else { //tipo de entidad individual "individual" == $entity_type
<?php get_template_part( 'content', 'archive' ); ?>
echo '<h2>Organizaciones a las que pertenece '. $tit .'</h2>';
<?php endwhile; else: ?>
}
?>
<!-- The Loop of entidades-->
<div class="quienes">
<?php
$args = array(
'post_type' => 'entidad', //sets post type to "entidad"
'order' => 'DESC',
'posts_per_page'=> -1,
'post__in' => $pertenece_id, //id de la entidad a la que pertenece
);
$my_query = new WP_Query($args);
$wp_count = $my_query->post_count;
if ($my_query->have_posts() ) : while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
<?php get_template_part( 'content', 'archive' ); ?>
<?php endwhile; else: ?>
<p><?php _e('No items.'); ?></p>
<?php endif; ?>
</div>
<!-- End Loop -->
<?php } ?>
<p><?php _e('No items.'); ?></p>
<?php endif; ?>
</div>
<!-- End Loop -->
<!--
<h2>Personas que pertenecen a <?php echo $usuario_web["user_nicename"]; ?>:</h2>
<ul>
......@@ -245,7 +249,7 @@ $entity_type_simple = $entity_type[0]->slug;
<?php endforeach; ?>
<?php endif; ?>
</ul>
<?php } ?>
......
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