Forum
Different visual theme of homepage with different post type - is it possible?
I have a site with three main post types - news, apps and blog. Each post type has it's own visual template. The news is bright white, apps are yellow, the blog is green. The homepage displays only one (most recent) post (+ navigation and footer).
Is it possible to have my homepage look different, depending on the actual post type active? For example, if the most recent post is News, the theme of the homepage will be bright white. If the next post is blog, theme of the homepage will be green etc.
And of yes, should I do it with blog sections or multiple blogs or different collections (in Runway) or....?
Thanks!
Yes, you can use the
template
option to specify a template to use on your homepage. Within that template you can useperch:if
to testpostTemplate
and switch to vary things as necessary between your types of post.Thanks Drew! Can you just make a rugh sketch of a code example that I need to use with perch:if tag?
Do I use perch:if inside of php code or directly in template or....?
Thanks Drew, will try that!!