Title: Passing Variable Via Excerpt Function
Last modified: August 20, 2016

---

# Passing Variable Via Excerpt Function

 *  [wealthontap](https://wordpress.org/support/users/wealthontap/)
 * (@wealthontap)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/passing-variable-via-excerpt-function/)
 * I’m trying to display three different excerpt layouts on my home page.
 * The way I imagine it working is to pass a variable via the excerpt function and
   using an if statement to decipher which layout to use.
 * I found this post [http://www.catswhocode.com/blog/how-to-overwrite-wordpress-core-functions](http://www.catswhocode.com/blog/how-to-overwrite-wordpress-core-functions)
   which I assume is what I need to do.
 * However by that point I’m pretty much in over my head so I am hoping someone 
   here can first off tell me if this is even possible, and if so provide me with
   the code I need.
 * I have a plugin which includes a template for the excerpt therefore the variable
   needs to be passed into the template. So I’m not sure if the_exceprt($variable)
   is going to cut it or not. Or perhaps I can just declare the variable as global?
 * Anyhow I hope that makes sense, any help would be much appreciated. There is 
   likely a much easier way to achieve this.
 * Cheers,
    Mike.

The topic ‘Passing Variable Via Excerpt Function’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [wealthontap](https://wordpress.org/support/users/wealthontap/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/passing-variable-via-excerpt-function/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
