ThemeShaper Forums » Thematic

[closed]

Strategy, Function for WP 3.1 Post Formats in Thematic

(6 posts)
  • Started 3 years ago by sfrangos
  • Latest reply from slambert
  • This topic is not resolved
  1. Hello Colleagues -

    I saw one other post submitted where the poster asked Gene about the new Post Formats in WP 3.1 and if Thematic deals with these yet. Gene did not reply but the consensus was that it does not, so this is to a) outline the opportunity, b) discuss ways to program for it.

    WHAT ARE POST FORMATS? From the Codes: "Post Formats is a theme feature introduced with Version 3.1. A Post Format is a piece of meta information that can be used by a theme to customize its presentation of a post. The Post Formats feature provides a standardized list of formats that are available to all themes that support the feature. Themes are not required to support every format on the list. New formats cannot be introduced by themes nor even plugins.
    VISUAL EXAMPLE: http://wpti.ps/functions/playing-with-post-formats-of-wordpress-3-1/

    PROGRAMMING STRATEGY & TACTICS: If you read around on the web, there are a couple of ways to create different looks for different post formats being presented. The first, I found is to program into your index loop a check to see if the page generated is a particular post format, then calling in your specific "dif" formatting. The second is to instruct WP, via a function, to look for specific templates in the theme folder, which in this case would be your child theme of thematic folder. See discussion and code example at bottom here in codex: http://codex.wordpress.org/Function_Reference/get_post_format

    Now I know that some programmers favor no use of templates, but since they are a standard WP convention, I am inclined to consider this tactic as an option.

    Dougal Campbell also has posted a good critique of different approaches, where he rules out the "else if" block of code tactic in favor of using a "get template" solution, here: http://dougal.gunters.org/blog/2010/12/10/smarter-post-formats

    So, before the good Thematic core programmers have a chance to work it into Thematic core, my thought is that we need a good function written to instruct the thematic child theme to look for the appropriate post format template as described at above links. I will send a $30 Amazon.com gift certificate to the best function written and posted here.

    - Scott

    Posted 3 years ago #
  2. i got them to work on my thematic child theme very simply:

    I added this code to my functions.php in my child theme:

    //post format support for the theme
    add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat' ) );

    and then i added these classes to my css:

    /* post-formats 'aside', gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat */
    
    .format-aside {
    }
    
    .format-gallery {
    }
    
    .format-link {
    }
    
    .format-image {
    }
    
    .format-quote {
    }
    
    .format-status {
    }
    
    .format-video {
    }
    
    .format-audio {
    }
    
    .format-chat {
    }

    And then i went and styled the css! It worked for me. Let me know what you think! =)

    Posted 3 years ago #
  3. @haza
    i would consider that as a quick fix, to change between styling.
    post-formats are meant to also present information differently.
    essentially, this needs to be done via code (as sfrangos mentions).

    @sfrangos, i've only just started to dig in yesterday. currently siding with get_template_part() over elseif, i'll post any updates if they arise.

    Posted 3 years ago #
  4. sowingseeds
    Member

    I have just uploaded 3.1 and I find that post formats do not operate when defining('THEMATIC_COMPATIBLE_POST_CLASS', true); is activated. Have I missed something or is there a fix?

    Posted 3 years ago #
  5. my thought is that we need a good function written to instruct the thematic child theme to look for the appropriate post format template as described at above links.

    thank you, this is exactly what I was looking for - some way to add it all with functions.php and not touch a single core file!

    Posted 3 years ago #
  6. I've been doing a lot of post format troubleshooting in my child theme. I'd like the post format selectors (.format-image, .format-video, etc) to be in the post class - which isn't happening. When I echo out post_class(), the format selector is there, but it's not when I echo thematic_post_class().

    Is it possible to update the thematic_post_class() function to display post formats automatically? Then you could just add the generated selectors to style.css in the child theme and not have to create a custom function. This seems like it would be useful to a lot of people!

    Thanks all!

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.