Wordpress Documentation

advertise, Anuncio

Loop de WordPress

El Loop es el corazón de WordPress. Es lo que recupera y muestra el contenido (posts, páginas, CPTs).

 
				
					<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  <h2><?php the_title(); ?></h2>
  <div><?php the_content(); ?></div>
<?php endwhile; else: ?>
  <p>No posts found.</p>
<?php endif; ?>

				
			

✔️ Dentro del loop usas funciones como:

  • the_title()

  • the_content()

  • the_excerpt()

  • the_post_thumbnail()