0

I'm looking to edit my theme layout of the aside post format.

I have already included the add_theme_support() function to include the aside option when creating a post. However, the layout of an aside does not look good. I wish to style it pretty much identically to the video format.

Which file in my theme represents the aside post format layout?

  • 1
    In what context? Only a post format archive has a specific template. Other contexts are theme-specific. – Milo Jun 30 '15 at 21:11
1

Mostly you would just make CSS changes. For example, a post that has the aside format will have included in it's mark-up a class of format-aside which you could override in your own CSS, whether it be by way of child theme support or CSS plugin.

I've only just been playing with this today (incidentally, which is how I came across this question).

Example: You could hide the title of posts tagged with the quote post-format (ie format-quote) by including this in your CSS file:

.home .format-quote .entry-title {
    display: none;
}

This would then format that entry on your blog page / index to not include the title from the post, and would make the quote just appear as more of an inline quote between two posts.

Or you could include a background image or custom colour behind the post based on the format.

I haven't completed it yet, but I'm working on a format to use the post title as the author of a quote, and the content to be the quote content, and the position the title under the quote in smaller than <h2> tags, or possibly just add an ::after element to maybe include the word "says" or "said" so that the quote field could be presented thus:

Isaac Newton said:

I can calculate the motion of heavenly bodies, but not the madness of people.

There isn't a plethora of information out there, but here are a couple of links which go into a little further detail (the first being WordPress Codex):

WordPress Codex page on Post Formats
Elegant Themes Blog post: Creating Post Formats

1

You could edit some code in single.php file by using get_post_format() function to check your post format and show anything you want to show for each post format.

For example:

if ( get_post_format( get_the_ID() ) == 'aside' ) {
   // Show something different from another template here!!!
}
0

Create a template part for it named content-aside.php and use a conditional in single.php to call it:

if ( is_singular( 'aside' ) ) {
   get_template_part( 'content', 'aside');
} else {
   get_template_part( 'content', 'single');
}

A simple get_template_part() may do it too:

   if ( is_singular() ) {
      get_template_part( 'content', get_post_type() );
   }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.