Title: selective content
Last modified: August 19, 2016

---

# selective content

 *  [georgerobbo](https://wordpress.org/support/users/georgerobbo/)
 * (@georgerobbo)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/selective-content/)
 * Is there a way to be able to select a certain portion of the content for a description
   and limit it to 20 words or something?

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

 *  [monkeymynd](https://wordpress.org/support/users/monkeymynd/)
 * (@monkeymynd)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/selective-content/#post-1210857)
 * You probably want to look at the excerpt tag. This will select ‘x’ number of 
   characters from a post, but I think it will only select from the start of the
   post.
 * [http://codex.wordpress.org/Template_Tags/the_excerpt](http://codex.wordpress.org/Template_Tags/the_excerpt)
 *  [shane-g](https://wordpress.org/support/users/shane-g/)
 * (@shane-g)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/selective-content/#post-1210968)
 * Hi,
 * Add this code in functions.php file of your theme:
 *     ```
       function excerpt($num) {
       $limit = $num+1;
       $excerpt = explode(' ', get_the_excerpt(), $limit);
       array_pop($excerpt);
       $excerpt = implode(" ",$excerpt)."...";
       echo $excerpt;
       }
       ```
   
 * Instead of using the_excerpt in your loop use excerpt(‘word-limit’) so if you
   want to limit your excerpt to 25 words the code would look like this:
 *  <? php excerpt(’25’); ?>
 * Thanks,
 * Shane G.

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

The topic ‘selective content’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 3 participants
 * Last reply from: [shane-g](https://wordpress.org/support/users/shane-g/)
 * Last activity: [16 years, 8 months ago](https://wordpress.org/support/topic/selective-content/#post-1210968)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
