
drlitross
Delta
Programador
Verificado
Verificación en dos pasos activada
Verificado por Whatsapp
Hola buenas, soy un, programador que trabajo con python y algo de java. Realmente no tengo mucha idea de php y del codex de wordpress. Os explico, quiero mostrar los post de una categoría en concreto con el codigo de abajo (el cual funciona en ambitos generales, muestra todas los post de todas las categorías), pero quiero que muestre tan solo de una en concreto. Mi pregunta es. ¿Como se haría?, imagino que es con <?php is_category ()?> pero realmente no me funciona. Espero vuestra respuesta, gracias anticipadas y un saludo!
PHP:
<div class="clust-container galmode-apps">
<h2 class="clust-heading">Rantamplan</h2>
<ol class="card-list">
<?php while (have_posts()) { the_post();?>
<li>
<a href="<?php the_permalink(); ?>" title="<?php the_title();?>" class="card-click-target" aria-hidden="true" tabindex="-1"></a>
<div class="icon">
<a href="<?php the_permalink(); ?>" title="<?php the_title();?>"><img src="<?php bloginfo('template_url'); ?>/tt.php?w=100&h=100&src=<?php echo get_the_post_thumbnail_url(get_the_ID(), 'thumbnail'); ?>" alt="<?php the_title();?>" class="gal_listthumb" height="115"></a>
</div>
<div class="details mt10">
<div class="title">
<a href="<?php the_permalink(); ?>" title="<?php the_title();?>">
<?php the_title();?>
</a>
</div>
<div align="center"><?php $min=1236; $max=2142; echo rand($min,$max); ?> Clin</div>
<div align="center"><?php $min=612; $max=1136; echo rand($min,$max); ?> Clan</div>
<div class="rating"><span class="<?php
$input = array("rating-static rating-35", "rating-static rating-40", "rating-static rating-45", "rating-static rating-50");
$rand_keys = array_rand($input, 2);
echo $input[$rand_keys[0]];
?>">Rated 45/5</span></div>
</div>
<div class="download"><a href="/descargar/<?php the_ID(); ?>">Descargar</a></div>
</li>
<?php } ?>
</ol>
</div>