I'm doing a function to bring some courses for that I have a post type where I charge the courses and a taxonomy of marks that I assign to which course they belong to show this I have a section that is a filtering where I have to tell you which courses are find active, for that create a field customs fields selector to put that course is enabled / not enabled. The problem is that when I enable a course from backend, it does not show it to me.
The example can be seen here also attached a photo of how is the filter
The query is as follows;
<div class="col-md-12 text-center">
<div id="filter" class="animated fadeInDown bottomspace10">
<ul>
<li><a href="#" data-filter="*" class="selected"><i class="icon icon-reorder"></i> Ver Todos</a></li>
<li><a href="#" data-filter=".activo" title="¡Fechas Definidas!"><i class="icon icon-th"></i> Cursos Activos</a></li>
<li>Líneas:</li>
<?php
$terms = get_terms('categoria-cursos', get_queried_object());
if($terms){
foreach ($terms as $termino){ ?>
<li>
<a href="#" data-filter=".id<?php echo $termino->term_id;?>"><i class="icon icon-th"></i>
<?php echo $termino->name; ?>
</a>
</li>
<?php } }?>
</ul>
</div>
</div>
<div id="content">
<?php if($terms){ //si existe contenido
foreach($terms as $termino){
$args = array(
'post_type' => 'curso',
'showposts'=> -1,
'tax_query' => array(
array(
'taxonomy' => 'categoria-cursos',
'field' => 'id',
'terms' => $termino->term_id
)
)
);
$posts = new WP_Query( $args );
if($post){
while($posts->have_posts()):
$posts->the_post();
$cur = $post;
?>
<div class="boxportfolio1 bp-height item id<?php echo $termino->term_id;?> <?php if(get_terms('curso_activo',$cur->ID) == 'habilitado'){echo 'activo';}?>">
<!-- desde acá parte un bloque -->
<div class="boxcontainer">
<div class="prod-imagecontainer">
<img src="<?php echo get_the_post_thumbnail_url($cur->ID,'thumbnail'); ?>" alt="<?php echo $cur->post_title; ?>">
</div>
<div class="roll">
<div class="wrapcaption">
<a href="<?php echo get_the_permalink($cur->ID); ?>"><i class="icon-arrow-right captionicons"></i></a>
</div>
</div>
<div class="prod-infocontainer">
<h1>
<a href="vero-alphacam-router.html">
<?php echo $cur->post_title; //este es tl titulo?>
</a>
</h1>
<p>
<?php echo get_the_content($cur->ID);?>
</p>
</div>
</div>
</div>
<?php endwhile;
}
?>
<?php } } ?>
</div>