sage-directives icon indicating copy to clipboard operation
sage-directives copied to clipboard

Post Class

Open fabianwurk opened this issue 5 years ago • 4 comments

Can't see directive for 'post_class()'? eg.

<article <?php post_class() ?>>

There seems to be one for body_class() though. Just wondering am I missing it?

Thanks.

fabianwurk avatar Jan 09 '20 16:01 fabianwurk

It doesn't exist. I'm not HUGE on the @bodyclass directive as-is– but seeing as it's already here, I'll add @postclass too when I get a chance.

Log1x avatar Jan 09 '20 18:01 Log1x

Thats great, thanks.

fabianwurk avatar Jan 10 '20 01:01 fabianwurk

Is this correct directive:

'postclass' => function ($expression) { return "<?php post_class({$expression}); ?>"; },

fabianwurk avatar Jan 10 '20 10:01 fabianwurk

yeah thats more or less it + adding reference in the docs

Log1x avatar Jan 11 '20 11:01 Log1x