Title: CSS class specific to content type
Last modified: June 7, 2020

---

# CSS class specific to content type

 *  [princeofabyss](https://wordpress.org/support/users/princeofabyss/)
 * (@princeofabyss)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/css-class-specific-to-content-type/)
 * Three years ago I opened a topic ([https://wordpress.org/support/topic/specific-class-according-to-content-type/](https://wordpress.org/support/topic/specific-class-according-to-content-type/))
   requesting a feature, where a CSS class would be added, specificely to the content
   of the article being displayed. Something like addthis_home for the homepage,
   addthis_pages for pages, addthis_posts for blog entries, etc…
 * Back then, a contributor had replied that I could use another plugin of the same
   author to achieve the functionality I needed, which by now is already abandoned…
 * Anyway, for that version of the plugin, and for any update that was released 
   for it, I was modifying the code myself to achieve that functionality.
 * But since in the current version it’s just a matter of altering a single line
   in the code of the plugin, would you consider adding the feature in the stock
   release? Honestly it’s so frustrating to monitor the sites I administer, that
   use this plugin to manually update the code… The problem is I can’t overload 
   the stock method in functions.php so that the functionality remains even after
   an update of the plugin…
 * So, the code edit I’m proposing is this:
 * File _addthis/backend/AddThisFeature.php_
 * Line 1510, change:
 * `$htmlTemplate = '<div class="%1$s addthis_tool" %2$s></div>';`
 * To:
 * `$htmlTemplate = '<div class="%1$s addthis_tool addthis_'.AddThisTool::currentTemplateType().'"%
   2$s></div>';`
 * I hope I get back from you regarding this feature request!
 * Regards.

The topic ‘CSS class specific to content type’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/addthis_70cced.svg)
 * [WordPress Share Buttons Plugin – AddThis](https://wordpress.org/plugins/addthis/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/addthis/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/addthis/)
 * [Active Topics](https://wordpress.org/support/plugin/addthis/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/addthis/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/addthis/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [princeofabyss](https://wordpress.org/support/users/princeofabyss/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/css-class-specific-to-content-type/)
 * Status: not resolved