WordPress body_class() theme review requirement

wordpress

#1

My question is to the Themeforest Review team,

I’m thinking about working on a theme that uses smoothstate.js (because it looks like fun) but before I invest any time or effort exploring it I wanted to know if there are any review requirements that state that body_class() has to be called on the opening body tag of a page?

In order for smoothstate to work with WordPress, specifically for the body classes to be updated between page transition, body_class() would be applied to a div immediately after the body tag. So it would be like this:

<body>
<div <?php body_class(); ?>>
...

The classes would be present and would wrap all other page content but would not be on the body element. Would this pass the theme review?


#2

Could you not just move the classes over onto your div element when you initialise your javascript plugin?


#3

I haven’t looking into the smoothstate.js plugin in much detail yet but from what I have read so far I don’t think the body element of each page is loaded after page transitions. Instead you specify a container in the JS and the plugin only load elements within that that have changed between pages.


#4

hey @EugeneO did you ever get an answer on this?


#5

No I didn’t get an official response but I don’t think it would make it through the review process.


#6

https://codex.wordpress.org/Theme_Development#Theme_Classes