Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Post formats #165

Closed
ghost opened this Issue · 16 comments

6 participants

@ghost

I changed my copy of underscores to support post formats. To do this, change line 18 in single.php from:

<?php get_template_part( 'content', 'single' ); ?>

to:

<?php get_template_part( 'content', get_post_format() ); ?>

@iamtakashi
Owner

@stevezehngut, I see the following two issues with just changing the line.

  1. The anchor inside entry-title would link to the post page itself.
  2. There are differences in content laid out inside footer.entry-meta between content.php and content-single.php and the one for content-single.php won't be used.

I can see where @stevezehngut is coming from and I think post formats should be displayed in the same way between index, archive, and single views.

It could be a good idea to merge content.php and content-single.php and having the is_single() conditional tag to control the markup but the only thing is that it would bloat the content.php.

I can see themers are going to have different markups for each format in future themes, especially post formats are getting more attention from 3.6, and having one content.php for standard format could make more sense.

@ghost

Let me know if I can help in any way. I am currently making these changes manually each time I download underscores.

@mfields

It could be a good idea to merge content.php and content-single.php and having the is_single() conditional tag to control the markup but the only thing is that it would bloat the content.php.

This makes sense to me. I checked and Twenty Thirteen conditionally render the link on the title. I think that setting up post formats to be consistent between templates is worth the addition of the conditional.

@ghost

How do I submit code back to this repo?

@philiparthurmoore
Collaborator

@stevezehngut Easiest way for you would be to fork _s, make a change on your copy, and then initiate a pull request. See https://help.github.com/articles/using-pull-requests also.

@ghost

Sorry, I should have been more specific. I am technically comfortable with everything you said. Do I need to be authorized in some way to do a push?

@philiparthurmoore
Collaborator

Oh! Not really. Just fork _s into your own version of it, make your change, and then submit a pull request. You won't be able to commit directly to the Automattic version of _s if that's what you mean.

@ghost

Disregard my last comment. I am reading up on the process now.

@ghost

Cool deal. Thanks.

@ghost

Awesome

@aminriadh

Does this work? "<?php get_template_part( 'content', get_post_format() ); ?>"

I use 'content-single-gallery' - 'content-single-quote' and etc.

And my content-single looks like this:

"$format = get_post_format();
if ( false === $format )
$format = 'standard';
get_template_part( 'content-single', $format );
"

@obenland
Owner

No activity in two weeks. Can we close it and wait for the pull request?

@philiparthurmoore
Collaborator

Works for me.

@mfields

I think we should wait for 3.6 and discuss how post formats will best be handled in themes moving forward.

@marksantiago marksantiago referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.