Title: the_excerpt(); into an array
Last modified: August 19, 2016

---

# the_excerpt(); into an array

 *  [Yeowza](https://wordpress.org/support/users/yeowza/)
 * (@yeowza)
 * [16 years ago](https://wordpress.org/support/topic/the_excerpt-into-an-array/)
 * Hello guys, i would like to store all of the posts excerpts into an array so 
   i can cycle through them later. Not sure how to go about this though..
 * Here is what I have so far..
 *     ```
       <?php	query_posts('cat=featured'); $counter = 0;
       			while ( have_posts() ) : the_post();
   
       			$text[$counter] = the_excerpt();
   
       			$counter++;
       			endwhile;
       ?>
   
       <span style = 'line-height: 20px; font-size: 12px; color: #CCC; '>
       	<?php echo $text[0]; ?>
       </span>
       ```
   
 * This does not give me an error, just no output it seems. Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Yeowza](https://wordpress.org/support/users/yeowza/)
 * (@yeowza)
 * [16 years ago](https://wordpress.org/support/topic/the_excerpt-into-an-array/#post-1500742)
 * I guess what would make or break this idea is if the_excerpt() echoes out the
   info or returns a value..
 * I’m thinking echoes.. >_< Do you all see any way I could do this?
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [16 years ago](https://wordpress.org/support/topic/the_excerpt-into-an-array/#post-1500927)
 * `get_the_excerpt()` will return a string
 * [http://codex.wordpress.org/Function_Reference/get_the_excerpt](http://codex.wordpress.org/Function_Reference/get_the_excerpt)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘the_excerpt(); into an array’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/the_excerpt-into-an-array/#post-1500927)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
