Hola amigos, les agradeceria su ayuda, estoy usando este codigo php en mi web:
Código PHP:
<?php
$posts = get_field('selector_de_noticias');
if( $posts ): ?>
<?php foreach( $posts as $p ): ?>
<li>
<a class="titulo_noticia_evento_link" href="<?php echo get_permalink( $p->ID ); ?>"><?php echo get_the_title( $p->ID ); ?></a>
<div class="imagen_noticia_evento"> <?php echo get_the_post_thumbnail( $p->ID ); ?> </div>
</li>
<?php endforeach; ?>
Y me gustaria saber como mostrar un numero limitado de post, me dan este codigo:
Código PHP:
<?php
// get only first 3 results
$ids = get_field('conference_talks', false, false);
$query = new WP_Query(array(
'post_type' => 'conferences',
'posts_per_page' => 3,
'post__in' => $ids,
'post_status' => 'any',
'orderby' => 'rand',
));
?>
Pero nose como insertar esto que me dan en mi codigo, espero me puedan ayudar, muchas gracias de ante mano