Title: Post Type problem
Last modified: August 31, 2016

---

# Post Type problem

 *  Resolved [jhoell](https://wordpress.org/support/users/jhoell/)
 * (@jhoell)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/post-type-problem-2/)
 * Custom post types with underscores cannot be used with this widget. The underscores
   get stripped out on save. Can you fix this?
 * [https://wordpress.org/plugins/recently/](https://wordpress.org/plugins/recently/)

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

 *  Thread Starter [jhoell](https://wordpress.org/support/users/jhoell/)
 * (@jhoell)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/post-type-problem-2/#post-7253596)
 * The {thumb} parameter also does not wrap the link to the post around the thumbnail
   image.
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/post-type-problem-2/#post-7253742)
 * Hi there!
 * Thanks for the report. I’ll have a look at this as soon as possible.
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/post-type-problem-2/#post-7253749)
 * > Custom post types with underscores cannot be used with this widget. The underscores
   > get stripped out on save.
 * You’re right, underscores and dashes as well are being stripped out by the widget.
   I won’t be able to push an update till next week at least though, so for the 
   time being please follow these instructions:
    1. Go to _Plugins > Editor_ and pick _Recently_ from the dropdown.
    2. Find (around line 453):
    3.     ```
           // Post type
           $instance['args']['post_type'] = ( '' == $new_instance['post_type'] )
             ? array('post')
             : explode(",", preg_replace( '|[^a-z0-9,]|', '', $new_instance['post_type'] ));
           ```
       
    4. … and change it to:
    5.     ```
           // Post type
           $instance['args']['post_type'] = ( '' == $new_instance['post_type'] )
             ? array('post')
             : explode(",", preg_replace( '|[^a-z0-9,_-]|', '', $new_instance['post_type'] ));
           ```
       
    6. Hit the Update file button to save changes.
 * That should do the trick.
 *  Thread Starter [jhoell](https://wordpress.org/support/users/jhoell/)
 * (@jhoell)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/post-type-problem-2/#post-7253799)
 * Perfect, thank you.

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

The topic ‘Post Type problem’ is closed to new replies.

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

## Tags

 * [CTP](https://wordpress.org/support/topic-tag/ctp/)
 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [recent](https://wordpress.org/support/topic-tag/recent/)

 * 4 replies
 * 2 participants
 * Last reply from: [jhoell](https://wordpress.org/support/users/jhoell/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/post-type-problem-2/#post-7253799)
 * Status: resolved