Title: Advert Post Media
Last modified: August 31, 2016

---

# Advert Post Media

 *  Resolved [ananzhe25](https://wordpress.org/support/users/ananzhe25/)
 * (@ananzhe25)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/advert-post-media/)
 * Hi,
 * First, I like to thank you for this great classified plugins.
    Second, I installed
   the plugins but I have a problem.
 * I need to insert the thumbnails in post content beside gallery. I tried the following
   code to return the post thumbnail and insert to the the post. It does work for
   default post but not for custom post type ‘advert’. How to go around that? Plus
   the code below return one image only. How can we make it return all attached 
   thumbnail?
 *     ```
       add_filter('the_content', 'put_thumbnail_in_posting');
       function put_thumbnail_in_posting($content) {
       global $post;
       if ( has_post_thumbnail() && ( $post->post_type == 'post' ) ) { the_post_thumbnail( '', array( 'style' => 'float:left;margin:15px;' ) ); }
       return $content;
       }
       ```
   
 * I really appreciate your help.
 * Thank you!
 * [https://wordpress.org/plugins/wpadverts/](https://wordpress.org/plugins/wpadverts/)

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

 *  Plugin Author [Greg Winiarski](https://wordpress.org/support/users/gwin/)
 * (@gwin)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/advert-post-media/#post-7236861)
 * Hi,
    in your code try changing
 *     ```
       $post->post_type == 'post'
       ```
   
 * to
 *     ```
       in_array($post->post_type, array('post', 'advert'))
       ```
   
 *  Thread Starter [ananzhe25](https://wordpress.org/support/users/ananzhe25/)
 * (@ananzhe25)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/advert-post-media/#post-7237012)
 * Hi Greg,
 * Thank you for your answer. The full answer found here:
 * [http://wordpress.stackexchange.com/questions/222564/media-thumbnail-for-custom-post-inside-post-content/222569#222569](http://wordpress.stackexchange.com/questions/222564/media-thumbnail-for-custom-post-inside-post-content/222569#222569)
 *  Thread Starter [ananzhe25](https://wordpress.org/support/users/ananzhe25/)
 * (@ananzhe25)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/advert-post-media/#post-7237013)
 * The answer above is helpful if you need image inside post content.

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

The topic ‘Advert Post Media’ is closed to new replies.

 * ![](https://ps.w.org/wpadverts/assets/icon-256x256.png?rev=2423472)
 * [WPAdverts - Classifieds Plugin](https://wordpress.org/plugins/wpadverts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpadverts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpadverts/)
 * [Active Topics](https://wordpress.org/support/plugin/wpadverts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpadverts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpadverts/reviews/)

## Tags

 * [custom post](https://wordpress.org/support/topic-tag/custom-post/)
 * [thumbnail](https://wordpress.org/support/topic-tag/thumbnail/)

 * 3 replies
 * 2 participants
 * Last reply from: [ananzhe25](https://wordpress.org/support/users/ananzhe25/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/advert-post-media/#post-7237013)
 * Status: resolved