WordPress.org

Ready to get started?Download WordPress

Codex

es:Función de referencia/the post

This page is marked as incomplete. You can help Codex by expanding it.
NOTE: No eliminar enlaces originales hasta asegurarse de que en castellano también existen traducidos Diego AG 17:15, 5 December 2013 (UTC)

Contents

Descripción

Itera el índice de envíos (posts) en el The Loop es:El bucle. Recupera el siguiente envío, establece el envío, establece a verdadera la propiedad 'en el bucle' ('in the loop').

Uso

<?php the_post(); ?>

Parámetros

Esta función no acepta parámetros.

Valores de retorno

Esta función no retorna ningún valor.

Ejemplos

<?php
while ( have_posts() ) : the_post();
	echo '<h2>';
	the_title();
	echo '</h2>';
	the_content();
endwhile;
?>

Notas

Log de cambios

Fichero fuente

the_post() está ubicado en wp-includes/query.php.

Relacionado

Articles

Code Documentation

  • Class: WP_Query - Detailed Overview of class WP_Query
  • Object: $wpdb - Overview on the use of the $wpdb object
  • Function: get_query_var()
  • Function: query_posts() - Create additional custom query
  • Function: get_post() - Take an ID of an item and return the records in the database for that article
  • Function: get_posts() - A specialized function that returns an array of items
  • Function: get_pages() - A specialized function that returns an array of pages
  • Function: have posts() - a condition that determines whether the query returned an article
  • Function: the_post() - Used to automatically set the loop after a query
  • Function: rewind_posts() - Clears the current loop
  • Function: setup_postdata() - Sets the data for a single query result within a loop
  • Function: wp_reset_postdata() - Restores the previous query (usually after a loop within another loop)
  • Function: wp_reset_query()
  • Function: is_main_query() - Ensures that the query that is being changed is only the main query
  • Action Hook: pre_get_posts - Change WordPress queries before they are executed
  • Action Hook: the_post - Modify the post object after query
  • Filter Hook: found_posts - Changes the value of the object found_posts WP_Query
See also index of Function Reference and index of Template Tags.