[wp-trac] [WordPress Trac] #35164: Singular body class and main post post class

WordPress Trac noreply at wordpress.org
Sat Dec 19 11:53:30 UTC 2015


#35164: Singular body class and main post post class
--------------------------+-----------------------------
 Reporter:  danielpataki  |      Owner:
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I think it would be pretty useful to be able to style all singular posts
 with one selector. I thought it might be a good idea to output ".singular"
 using the `body_class()` function. This would allow people to target all
 singular pages.

 In addition, detecting the main post on the page would be useful if
 someone had some related posts on a singular page. So the class ".main-
 post" could by added using the `post_class()` function.

 I'm using this method via hooks in a theme so I can say: `.singular .main-
 post {}` which allows me to style posts and pages with one selector and
 give a default look to all custom post types.

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


More information about the wp-trac mailing list