Query post category within Repeater Template/s
-
Hello ??
Is it possible to query the category of the post within the Repeater Template to in turn amend the layout that this outputs?
I basically have a grid of Posts I would like to output, some will be News, Client stories, Events, each being a different post category, and depending upon the category I need it to show with a certain box class, different fields, etc. as I need them to all look different.
Something like :
if ( in_category ( ‘event’ ) ) {
<article class=”box-event”>…</article>
} elseif ( in_category ( ‘client-story’ ) ) {
<article class=”banner-clientstory”>…</article>
} else {
<article class=”box-news”>…</article>
}Is this possible? And sorry if this is somewhere in the documentation, I couldn’t spot it.
Many thanks ??
- The topic ‘Query post category within Repeater Template/s’ is closed to new replies.