Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add a Post Format Archives heading to archive.php #95

Closed
wants to merge 2 commits into from

9 participants

@sixhours
Owner

When posts of a certain post format are viewed as an archive, the heading reads simply "Archives". For clarity, we could add a more specific heading for these types of archives, eg. "Post Format Archives: aside"

@philiparthurmoore
Collaborator

I'd be in favor of something more short and sweet: Asides, Links, Galleries, etc. Basically just the plural form of what you see from the post editor.

@sixhours
Owner

(Cleaned up post format slug with get_post_format_string())

@sixhours
Owner

@philiparthurmoore I see your point, but code-wise, that seems overly complex, since you have to check the format, then pluralize it, then output it. Unless there's a pluralize function we could use to do this more easily?

This follows the same syntax as the other archive types in _s (though I'd be open to simplifying those, too -- "Category Archives" to "Category", for example).

@jayj

Justin Tadlock wrote a post about post format plural strings http://justintadlock.com/archives/2012/09/07/post-format-plural-strings

@mfields

I agree with @philiparthurmoore here. Outputting "Asides", "Links", "Videos", etc. would be ideal. I've dove into this area a few times with different theme. Here is the library that I'm currently using https://gist.github.com/3950447

It's not fully-fleshed for every different type of post (more than a few attachment types are un accounted for), but it covers most things.

@philiparthurmoore
Collaborator

Thinking more about this, I'm not sure I agree with the viewpoint that making short and sweet titles is overly complex. It's more code, but not more complex. A long page title such as "Post Format Archives: {Post Format}" feels like visual pollution; it's not short and sweet like Archives, or Daily Archives, etc. While it's more code, it's simpler on the front-end, which is most important.

Let's assume that we'll roll out support for the following Post Formats in _s: 'aside', 'image', 'video', 'quote', 'link' (which we'll end up doing anyway for all .com themes). The only code that would need to be added to archive.php is as follows:

            } elseif ( is_tax( 'post_format', 'post-format-aside' ) ) {
                _e( 'Asides', '_s' );

            } elseif ( is_tax( 'post_format', 'post-format-image' ) ) {
                _e( 'Images', '_s');

            } elseif ( is_tax( 'post_format', 'post-format-video' ) ) {
                _e( 'Videos', '_s' );

            } elseif ( is_tax( 'post_format', 'post-format-quote' ) ) {
                _e( 'Quotes', '_s' );

            } elseif ( is_tax( 'post_format', 'post-format-link' ) ) {
                _e( 'Links', '_s' );

That's not a ton of code for a lot more simplicity on the front end.

@lukemcdonald
} elseif ( is_tax( 'post_format' ) ) {
    printf( __( '%s Archives', '_s' ), '<span>' . get_post_format() . '</span>' );

This solution uses the term Archives as the plural word instead of the format name (e.g. Video Archives). I haven't used this method before, though I figured it may be good food for thought.

@mfields

My vote would be to go with something similar to the code posted by @philiparthurmoore. When I think of the term "archives", my mind usually creates an image of something old and stored away somewhere -> "filed away in the archives". Personally, the term "archive" makes a lot of sense in date queries; less so for formatted posts.

@obenland
Owner

Code-wise I like @thelukemcdonald's approach better, to be honest. I'm with you on your argument against 'Archive' though. How about '%s posts'? Or articles or entries? Either ucfirst or lcfirst.

Additionally, I think a context could not hurt. It does not necessarily have to be via _x(), a comment addressing translators would be sufficient.

@philiparthurmoore
Collaborator

I'll speak my piece again and then hold my peace and accept consensus. I think anything other than the name of the plural post format is completely unnecessary. Let's not think about what's easiest or hardest in terms of code; let's think about what's most beautiful for viewers, and what's the simplest title for a set of posts.

The words "archives" or "posts" or "entries" are redundant and ugly. Users know that they are looking at posts. They do not, however, know what type of posts they are looking at.

So Asides, Likes, Galleries, Audio, etc. seem the best bet. Even if it means writing a large-ish block of code to deal with the different plural form of each post format, it will in the end make websites more beautiful, and more simple.

@ianstewart
Owner

+1 to Philip's piece. I agree that it's "not a ton of code for a lot more simplicity on the front end."

@kovshenin
Owner

+1 to Philip as well, __( '%s Archives' ) will make absolutely no sense in some languages, for example Russian, unless you translate it to "Archives: %s" (with a stupid colon) which sucks even more.

@lukemcdonald

I like @philiparthurmoore approach as well; more straight forward and easily customizable. With that said, the site title should probably reflect the archive page title for each format as well. As it stands, the title will be Video | Site Name when it would probably be better as Videos | Site Name. We could remedy the issue and provide a more customizable approach by creating a function to map each post format to a plural name. We could then update the archive page title, the site title, and any additional titles where a user would like to use the plural version of the format name (e.g. A filterable post format navigation).

I've provided code in this pull request. I'm good with any direction, but figured I'ld add in my two cents again :)

@sixhours
Owner

I'm cool w/ Philip's approach, then. I wonder if we should also update "Category Archives" and "Tag Archives" to simply "Category: Category-Name" and "Tag: Tag-Name" to follow suit?

@michiecat
Owner

I wonder if we should also update "Category Archives" and "Tag Archives" to simply "Category: Category-Name" and "Tag: Tag-Name" to follow suit?

For the sake of consistency, I think we should update category and tag archives to follow the same pattern. I think the words "Category:" and "Tag:" should stay, to separate them from post formats.

@obenland obenland closed this in e3b4907
@marksantiago marksantiago referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@dbisso dbisso referenced this pull request from a commit in dbisso/_s
@dbisso dbisso Merge commit '220d682ab38b838bf8a80cbf10460efe8f84818f'
* commit '220d682ab38b838bf8a80cbf10460efe8f84818f':
  Improve Post Format Archive heads. Follows up on #95 and Automattic@e3b4907#diff-ff638db82c6ac72a05781ba3e086fdf0L48.
  Apply a natural box layout model to all elements; see #341.

Conflicts:
	style.css
5b7486e
@gatespace gatespace referenced this pull request from a commit in gatespace/_s
@gatespace gatespace Merge branch 'master' into ja
* master:
  Improve Post Format Archive heads. Follows up on #95 and Automattic@e3b4907#diff-ff638db82c6ac72a05781ba3e086fdf0L48.
  Apply a natural box layout model to all elements; see #341.
0f2a4dd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 24, 2012
  1. @sixhours
  2. @sixhours

    Update archive.php

    sixhours authored
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 0 deletions.
  1. +5 −0 archive.php
View
5 archive.php
@@ -45,6 +45,11 @@
} elseif ( is_year() ) {
printf( __( 'Yearly Archives: %s', '_s' ), '<span>' . get_the_date( 'Y' ) . '</span>' );
+ } elseif ( get_post_format() ) {
+ printf( __( 'Post Format Archives: %s', '_s' ), '<span>' . get_post_format_string( get_post_format() ) . '</span>' );
+
+ } else {
+
} else {
_e( 'Archives', '_s' );
Something went wrong with that request. Please try again.