[wp-trac] [WordPress Trac] #28482: Display hentry only on blog post in the post_class

WordPress Trac noreply at wordpress.org
Thu Jun 19 00:10:28 UTC 2014


#28482: Display hentry only on blog post in the post_class
-------------------------------+------------------------------
 Reporter:  grapplerulrich     |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  close              |     Focuses:  template
-------------------------------+------------------------------
Changes (by SergeyBiryukov):

 * focuses:   => template
 * component:  Appearance => Posts, Post Types


Old description:

> According to the [http://microformats.org/wiki/h-entry microformats.org
> wiki]
> > h-entry is often used with content intended to be syndicated, e.g. blog
> posts.
>
> We are displaying the `hentry` for all CPT's. This would only be needed
> for blogs.
>
> There are two possible solutions.
> - One solution would be to only display the class when it is a post.
>
> {{{
> if ( post == get_post_type() ) {
>         // hentry for hAtom compliance
>         $classes[] = 'hentry';
> }
> }}}
>
> - The second would be to remove it completely as I don't think WordPress
> should choose what structured data markup formats to use as there are a
> number of different structured data markup formats. Google recommends
> microdata at the moment. (I understand it is not so easy to remove
> something as a number of themes depend on it. I also know that themes can
> easily remove the class.)
>
> Code in question: https://github.com/WordPress/WordPress/blob/3.9-branch
> /wp-includes/post-template.php#L428
>
> Similar: https://core.trac.wordpress.org/ticket/26965

New description:

 According to the [http://microformats.org/wiki/h-entry microformats.org
 wiki]
 > h-entry is often used with content intended to be syndicated, e.g. blog
 posts.

 We are displaying the `hentry` for all CPT's. This would only be needed
 for blogs.

 There are two possible solutions.
 - One solution would be to only display the class when it is a post.

 {{{
 if ( post == get_post_type() ) {
         // hentry for hAtom compliance
         $classes[] = 'hentry';
 }
 }}}

 - The second would be to remove it completely as I don't think WordPress
 should choose what structured data markup formats to use as there are a
 number of different structured data markup formats. Google recommends
 microdata at the moment. (I understand it is not so easy to remove
 something as a number of themes depend on it. I also know that themes can
 easily remove the class.)

 Code in question: https://github.com/WordPress/WordPress/blob/3.9-branch
 /wp-includes/post-template.php#L428

 Similar: #26965

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28482#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list