[wp-trac] [WordPress Trac] #39493: Include custom post type slug as body class

WordPress Trac noreply at wordpress.org
Thu Jan 5 22:28:28 UTC 2017


#39493: Include custom post type slug as body class
-----------------------------+----------------------------
 Reporter:  danielbachhuber  |      Owner:
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  Future Release
Component:  Themes           |    Version:
 Severity:  normal           |   Keywords:  needs-patch
  Focuses:                   |
-----------------------------+----------------------------
 If I have a custom post type `product` and a post with slug `laptop`, then
 I can create a `single-product-laptop.php` template to render markup
 specific to this product.

 ''But'', a template needs styles too. It would be easier to target my CSS
 specific to this template if `single-product-laptop` was included as a
 body class.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39493>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list