-
Notifications
You must be signed in to change notification settings - Fork 104
Customizing b4st for Post Formats
b4st can handle WordPress Post Formats, because in functions/setup.php
it has:
// Add post formats support. See http://codex.wordpress.org/Post_Formats
add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat'));
There are three ways that you can customize the design of post formats in b4st:
Even if you do nothing else, you can style the post formats differently CSS classes:
-
On
index.php
,category.php
andauthor.php
, the looped posts (or exerpts) each have an<article>
wrapper tag that has a CSS class according to the post format (e.g..format-aside
,.format-quote
). -
On
single.php
, the<body>
tag has a class specific to your single posts's post format (e.g..single-format-aside
,.single-format-quote
).
The index.php
template (and author.php
and category.php
) obtains its loop from the partial loops/index-loop.php
. And each individual [post or excerpt] within that loop uses another partial, called loops/index-post.php
.
To make your own specific design for, e.g. aside [posts or excerpts] where these are displayed on index.php
, you can make a duplicate of loops/index-post.php
and rename it as loops/index-post-aside.php
. Then you can modify your new partial to suit your requirements.
The single.php
template obtains its content from loops/single-post.php
.
To make your own specific design for, e.g. aside single posts, you can make a duplicate of loops/single-post.php
and rename it as loops/single-post-aside.php
. Then you can modify your new partial to suit your requirements.
Note: the partial loops/single-post.php
has in it only the "main column content" of your single-post. You will still get the same header, sidebar and footer called by single.php
. But if you wish your various post formats to be more radically different from each other, then you must start by redesigning single.php
. For example:
- Cut the sidebar-call from
single.php
and paste it intoloops/single-post.php
. - Make a duplicate of
loops/single-post.php
and rename the new file asloops/single-post-gallery.php
. - Redesign
loops/single-post-gallery.php
. (You can even remove the sidebar if you need the full width for the gallery.)