Hola, donde puedo ubicar el IF y el ELSE en este código, muchas gracias de ante mano
Código PHP:
<?php
$ids = get_field('selector_de_noticias', false, false);
// get results
$query = new WP_Query(array(
'post_type' => 'noticiasparaeventos',
'posts_per_page' => 3,
'post__in' => $ids,
));
// The Loop
?>
<?php if( $query->have_posts() ): ?>
<ul>
<?php while ( $query->have_posts() ) : $query->the_post(); ?>
<li>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>
<?php wp_reset_query(); // Restore global post data stomped by the_post(). ?>
Mi ELSE seria algo asi:
Código PHP:
<?php else( $query != $ids() ): ?>
<p><?php _e( 'Lo sentimos, no hay contenido que mostrar.' ); ?></p>