Results 1 to 5 of 5

Thread: Post Formats and Quotes

  1. #1
    kovshenin's Avatar
    kovshenin is offline Hello World
    Join Date
    Sep 2011
    Location
    Moscow
    Posts
    14

    Beer Post Formats and Quotes

    Howdy friends! My question's more to think about rather than give a straight answer. I'm implementing post formats for a blog now and it's been pretty straightforward with video, audio, images and gallery post types but I'm now completely lost when it comes to quotes.

    So a quote is something that somebody once said, right? It doesn't have to be me and it doesn't have to be any of the other authors on the blog. In fact it could even be Albert Einstein or something. Now my design layouts quite nicely show the author of each post with an avatar and obviously a link to an archive of all posts by that author. Quotes have a very similar layout so I'd like to follow that convention, that is, have "Albert Einstein" as the author of the post/quote with his picture and a link to all quotes from him on my blog.

    Adding a new user every time I post a quote by somebody new is a no-no, besides, that would create even more burden when it comes to avatars/gravatars. I'm thinking if a meta box in the edit post screen called "override author" or something could help, but then again, I'll have to do some voodoo for author archives to show up nicely, probably hooking into the rewrite engine somewhere since WordPress will return a 404 for that.

    My second thought is custom taxonomies, like quote-authors or something, then I can have a decent URL and slug for each and have their avatar stored in JSON in the description fields (terms meta, hello? where are you?).

    So what are your thoughts on all of this? Has anybody dealt with something like this before? I'm thinking that a similar approach could be taken for Status posts, especially from Twitter.

    Thanks a lot!
    ~ Konstantin

    P.S. Sorry if "Themes and Templates" is not the right place for this post, but it's totally related to the visual aspect, i.e. what's the correct way to display quotes.
    Last edited by kovshenin; 09-27-2011 at 07:21 AM. Reason: p.s.

  2. #2
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    I think you'd be better off using custom post meta, for _quote_author. If you want to build a collection/archive of quotes by an author, it's simple enough to query by custom post meta. If you wanted to, you could even provide Theme Options for pre-defined quote authors, along with quote-author avatar uploads. Then your post custom metabox simply loops through the pre-defined quote authors, e.g. as a dropdown select field.

    I don't think it's a great approach to conflate "post author" with "quote author", for many reasons: UX, legal, etc.

    Note: you could take a very similar approach for the Status Post Format type. Your custom post meta could take either a Twitter username or status URL, etc. - which you could use to pull all the necessary content, using Twitter's API.
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  3. #3
    kovshenin's Avatar
    kovshenin is offline Hello World
    Join Date
    Sep 2011
    Location
    Moscow
    Posts
    14

    Default

    Chip, thanks for your suggestions. I've been trying to hook and filter various author output functions but in the end I actually created a new non-hierarchical taxonomy called People where I can select the people mentioned in the post. I've also created a meta field called override-author where I can select one of the chosen people to be the fake "author" of the post, and finally I use a custom "the_author" function inside my templates which overrides the author if necessary.

    This approach allows me to attach several people to one post, tweet, quote or anything else. For example, I'd like to quote John who said something about Robert, so I have both John and Robert attached to my quote post and I set John as the "author" of the quote/post. The author link will lead to /people/john/ (instead of /authors/admin/) which will be an archive of all posts not only "authored" by John but mentioning John too.

    Not sure if this solves my legal issue, perhaps I should add a "posted by Post Author" string somewhere next to John too and make it even more clear, although John is the real author of the quote but didn't post it there. Dilemma, hehe :)

    Anyhow, I chose taxonomies because they gave me people archives free of charge and I don't have to deal with any meta_query or custom rewrite rules, but I will now have to find a way to store more data with the terms like bio, links, photo, etc.

    Do you think custom post types could be a better approach? I can have a Person post type with a /people/ rewrite slug, I can have their avatars as post thumbnails, bios as post content, slugs, meta and everything else out of the box. I can then attach a Person to a Post using _person_id meta data and almost as easy as taxonomies, create archive templates for my post type. I'm a little worried about performance though.

    Thanks for your time!

  4. #4
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    All good questions, but I think you're extending the Quote Post Format type beyond its original intent, which is merely to be a quote. :)

    If I were to extend my custom post meta approach, to be able to provide nice-looking archives, I would simply use the default archive structure, e.g. "example.com/type/quote/". If I wanted to provide a per-quote-author filter, I would simply use add_query_var() to append ?quote-author=albert-einstein, and then add in the necessary filtering to the loop query. (You could even get really fancy, and add your own rewrite rules, so that "example.com/type/quote/?quote-author=albert-einstein" becomes "example.com/type/quote/author/albert-einstein".)

    I'm not a big fan of the taxonomy approach, because taxonomies are intended to be a way of *grouping posts*. Post meta data are intended to be a way to *ascribe post-specific meta data*, which IMHO is more what you're after here.

    I'd rather do interesting things with the loop query, than try to shoehorn a taxonomy into doing something it's not really designed to do. Just my preference. :)

    By the way: if this is going to be a public Theme, you'll need to rename/prefix your "the_author()" function. ;)
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  5. #5
    kovshenin's Avatar
    kovshenin is offline Hello World
    Join Date
    Sep 2011
    Location
    Moscow
    Posts
    14

    Default

    Thanks a lot Chip, you've been very helpful. Oh and "the_author" is not really "the_author" of course, more like array( &$this, "_the_author" );

    Thanks again!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •