# Include the featured image in the post

**URL:** <https://meta.discourse.org/t/include-the-featured-image-in-the-post/58196>\
**Category:** WordPress\
**Created:** [3월 1, 2017, 8:42오후 UTC](https://meta.discourse.org/t/include-the-featured-image-in-the-post/58196 "2017-03-01T20:42:57Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [3월 3, 2017, 5:35오전 UTC](https://meta.discourse.org/t/include-the-featured-image-in-the-post/58196/6 "2017-03-03T05:35:24Z")

</div>

I’m not sure, but it looks like there is a problem with the regular expression in the `preg_replace` statement. Try:  
`$excerpt = preg_replace( '/\[.*\]/', '', $excerpt );`

The best way to work things like this out is to do your development in a local development environment and figure out how to log the output so you can see what’s going on. (You can still connect to a remote Discourse forum. Just publish your posts to a private category.)

Getting too involved with basic PHP programming is probably outside of the scope of this forum. If you’re really stuck, send me a message and I’ll see if I can help.

---

_[View the full topic](https://meta.discourse.org/t/include-the-featured-image-in-the-post/58196)._
