Title: [Plugin: Custom Post Widget] Custom class or id
Last modified: August 19, 2016

---

# [Plugin: Custom Post Widget] Custom class or id

 *  Resolved [Vayu Robins](https://wordpress.org/support/users/vayu/)
 * (@vayu)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-custom-post-widget-custom-class-or-id/)
 * Hi.
 * This is just a request and not a problem. Thanks for sharing this great plugin
   by the way.
 * I think it would be great if it was possible write / add a custom id og class
   for each block.
 * I know an auto generated id is created, but it’s not as flexible as the ability
   to write my own class / id.
 * Just a tip. 🙂
 * Thanks
    Vayu
 * [http://wordpress.org/extend/plugins/custom-post-widget/](http://wordpress.org/extend/plugins/custom-post-widget/)

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

 *  Plugin Author [Johan van der Wijk](https://wordpress.org/support/users/vanderwijk/)
 * (@vanderwijk)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-custom-post-widget-custom-class-or-id/#post-1906658)
 * Hi Vayu,
 * I will consider this feature for a future upgrade. Because I don’t want to make
   configuring the widget more complex I could add a class based on the title of
   the custom post type in the widget, would that help?
 *  Thread Starter [Vayu Robins](https://wordpress.org/support/users/vayu/)
 * (@vayu)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/plugin-custom-post-widget-custom-class-or-id/#post-1906659)
 * Hi Johan.
 * Thanks for taking this into consideration. 🙂
    I understand. I guess that could
   be an option, however, not so good if the client should chose to change the title,
   which is more likely to happen than if there was a class/id input field.
 * Cordially
    Vayu
 *  [Will](https://wordpress.org/support/users/wlanni/)
 * (@wlanni)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-custom-post-widget-custom-class-or-id/#post-1906827)
 * Hello to both of you.
 * I was searching for this exact topic: how to add a custom class, and/or add a
   unique id, so I can target a re-used custom post block on multiple pages and 
   style them identically, AND have the confidence that when I’m done working on
   developing on my server, and pass this off to a client, that the ID will remain
   the same. (will it? have you ever tried that?)
 * Adding a class that matches the title would definitely help!!!
 * I could also wrap my content in my own html, but that is adding extra mark-up
   that I’d like to stay away from.
 *  [Will](https://wordpress.org/support/users/wlanni/)
 * (@wlanni)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/plugin-custom-post-widget-custom-class-or-id/#post-1906828)
 * Hey Vayu,
 * I did a further search to just try to filter the custom-post-widget classes, 
   and found this plugin.
 * Installed it, it totally works.
 * [http://wordpress.org/extend/plugins/kc-widget-enhancements/](http://wordpress.org/extend/plugins/kc-widget-enhancements/)
 *  Plugin Author [Johan van der Wijk](https://wordpress.org/support/users/vanderwijk/)
 * (@vanderwijk)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-custom-post-widget-custom-class-or-id/#post-1906835)
 * Hi Wlanni, thanks for sharing your solution!
 *  [katart17](https://wordpress.org/support/users/katart17/)
 * (@katart17)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/plugin-custom-post-widget-custom-class-or-id/#post-1906836)
 * I recently modified this widget to allow for a custom class within the shortcode.
 * You can see it here: [http://pastebin.com/2MeuBwLT](http://pastebin.com/2MeuBwLT)
 * I hope this helps and I would like to see this implemented in a future release.
 *  Plugin Author [Johan van der Wijk](https://wordpress.org/support/users/vanderwijk/)
 * (@vanderwijk)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-custom-post-widget-custom-class-or-id/#post-1906838)
 * Thanks for sharing your code, I have included it in the plugin!

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

The topic ‘[Plugin: Custom Post Widget] Custom class or id’ is closed to new replies.

 * ![](https://ps.w.org/custom-post-widget/assets/icon.svg?rev=2884166)
 * [Content Blocks (Custom Post Widget)](https://wordpress.org/plugins/custom-post-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-post-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-post-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-post-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-post-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-post-widget/reviews/)

 * 7 replies
 * 4 participants
 * Last reply from: [Johan van der Wijk](https://wordpress.org/support/users/vanderwijk/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/plugin-custom-post-widget-custom-class-or-id/#post-1906838)
 * Status: resolved