SlideShare una empresa de Scribd logo
1 de 20
Descargar para leer sin conexión
POST FORMATS
                              a new 3.1 feature




Wednesday, April 13, 2011
HI, I’M ALISON
                       i’ve worked with wordpress for last 5 years or so.
                               i’m big on front-end design, UI, etc

                                      twitter: @alisonmf
                                     site: alisonfoxall.com




Wednesday, April 13, 2011
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. New formats cannot be introduced by themes
                     nor even plugins. The standardization of this list provides both
                     compatibility between numerous themes and an avenue for external
                     blogging tools to access to this feature in a consistent fashion.

                     In short, with a theme that supports Post Formats, a blogger can change
                     how each post looks by choosing a Post Format from a radio-button list.




                                 POST FORMATS
                                        as defined in the Codex
                               http://codex.wordpress.org/Post_Formats
Wednesday, April 13, 2011
WHAT?
                             what is this term?




Wednesday, April 13, 2011
TUMBLR-STYLE POSTS
                            same blog, posts formatted in different ways

Wednesday, April 13, 2011
matt’s blog

Wednesday, April 13, 2011
regular post
Wednesday, April 13, 2011
post with only a link (top) & post as an aside (bottom)

Wednesday, April 13, 2011
tumblr theme

Wednesday, April 13, 2011
example of a chat in tumblr

Wednesday, April 13, 2011
OK, COOL.
      but couldn’t we do this already before with custom post types
                         or custom taxonomies?




Wednesday, April 13, 2011
STANDARDS, MY FRIEND
                       ■ aside - Typically styled without a title. Similar to a Facebook note update.
                       ■ gallery - A gallery of images. Post will likely contain a gallery shortcode and will have image
                         attachments.
                       ■ link - A link to another site. Themes may wish to use the first <a href=””> tag in the post
                         content as the external link for that post. An alternative approach could be if the post consists
                         only of a URL, then that will be the URL and the title (post_title) will be the name attached to
                         the anchor for it.
                       ■ image - A single image. The first <img /> tag in the post could be considered the image.
                         Alternatively, if the post consists only of a URL, that will be the image URL and the title of the
                         post (post_title) will be the title attribute for the image.
                       ■ quote - A quotation. Probably will contain a blockquote holding the quote content.
                         Alternatively, the quote may be just the content, with the source/author being the title.
                       ■ status - A short status update, similar to a Twitter status update.
                       ■ video - A single video. The first <video /> tag or object/embed in the post content could be
                            considered the video. Alternatively, if the post consists only of a URL, that will be the video
                            URL. May also contain the video as an attachment to the post, if video support is enabled on the
                            blog (like via a plugin).
                       ■ audio - An audio file. Could be used for Podcasting.
                       ■ chat - A chat transcript


                                      http://codex.wordpress.org/Post_Formats
Wednesday, April 13, 2011
POST TYPES VS. POST FORMATS
                                what’s the difference?


                            well, what’s the difference
                            between advertising and
                            marketing?




Wednesday, April 13, 2011
REMEMBER: with any custom post types, custom
                     taxonomies, and post formats, one thing to realize:


  THIS IS THEME DEVELOPMENT!
                            these features are activated at the theme level,
                             meaning that switching from theme to theme
                                you WILL lose front-end functionality.




Wednesday, April 13, 2011
 add_theme_support(	
  'post-­‐formats',	
  array(	
  'aside',	
  'status'	
  )	
  );	
  




                            	
  add_post_type_support(	
  'page',	
  'post-­‐formats'	
  );




                               ADDING SUPPORT
                   is as easy as adding menu support. throw this in your
                           functions.php file of your theme folder.


Wednesday, April 13, 2011
USAGE
                    it’s activated on my theme, now how do I style it all?




Wednesday, April 13, 2011
3 WAYS

                             1. conditionals
                                2. CSS level
                            3. template parts




Wednesday, April 13, 2011
CONDITIONALS
         while ( the_loop() ):
             if ( has_post_format( 'gallery' ) ) :
                 // big block of HTML to format a gallery post
               elseif ( has_post_format( 'video' ) ) :
                 // big block of similar HTML to format a video post
               elseif ( has_post_format( 'image' ) ) :
                       // big block of similar HTML to format an image post
               elseif ( has_post_format( 'aside' ) ) :
                    // big block of similar HTML to format an aside
                else :
                    // big block of similar HTML to format other post
                endif;
         endwhile;




                                    holy toledo!

Wednesday, April 13, 2011
CSS LEVEL

                                  .format-­‐status	
  h2	
  {display:	
  none;}



                            .format-­‐status	
  p	
  {text-­‐decoration:underline;}




                 unable to manipulate markup. easy fix for a few things.

Wednesday, April 13, 2011
TEMPLATE PARTS
                                  division in files (like custom pages)


             while ( the_loop() ):
                   get_template_part( 'format', get_post_format() );
             endwhile;




                            http://dougal.gunters.org/blog/2010/12/10/smarter-post-formats

Wednesday, April 13, 2011

Más contenido relacionado

Destacado

Speed up the Buyers Journey with an Epic Content Plan
Speed up the Buyers Journey with an Epic Content PlanSpeed up the Buyers Journey with an Epic Content Plan
Speed up the Buyers Journey with an Epic Content PlanSarah Shelnut
 
Webinar: Your Facebook 2017 Content Master Plan
Webinar: Your Facebook 2017 Content Master PlanWebinar: Your Facebook 2017 Content Master Plan
Webinar: Your Facebook 2017 Content Master PlanBuzzSumo
 
How To Not Freak Out About Content Marketing By JESS3
How To Not Freak Out About Content Marketing By JESS3How To Not Freak Out About Content Marketing By JESS3
How To Not Freak Out About Content Marketing By JESS3JESS3
 
20 Epic Examples of Content Marketing
20 Epic Examples of Content Marketing20 Epic Examples of Content Marketing
20 Epic Examples of Content MarketingJoe Pulizzi
 
Building an Integrated Content Strategy
Building an Integrated Content StrategyBuilding an Integrated Content Strategy
Building an Integrated Content StrategyJonathon Colman
 
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsThe Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsBarry Feldman
 

Destacado (6)

Speed up the Buyers Journey with an Epic Content Plan
Speed up the Buyers Journey with an Epic Content PlanSpeed up the Buyers Journey with an Epic Content Plan
Speed up the Buyers Journey with an Epic Content Plan
 
Webinar: Your Facebook 2017 Content Master Plan
Webinar: Your Facebook 2017 Content Master PlanWebinar: Your Facebook 2017 Content Master Plan
Webinar: Your Facebook 2017 Content Master Plan
 
How To Not Freak Out About Content Marketing By JESS3
How To Not Freak Out About Content Marketing By JESS3How To Not Freak Out About Content Marketing By JESS3
How To Not Freak Out About Content Marketing By JESS3
 
20 Epic Examples of Content Marketing
20 Epic Examples of Content Marketing20 Epic Examples of Content Marketing
20 Epic Examples of Content Marketing
 
Building an Integrated Content Strategy
Building an Integrated Content StrategyBuilding an Integrated Content Strategy
Building an Integrated Content Strategy
 
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsThe Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post Formats
 

Similar a Post Formats

Post Type Formats
Post Type FormatsPost Type Formats
Post Type Formatsrobingurl65
 
Wordpress accessibility enhancements
Wordpress accessibility enhancementsWordpress accessibility enhancements
Wordpress accessibility enhancementsTed Drake
 
Wordpress accessibility enhancements
Wordpress accessibility enhancementsWordpress accessibility enhancements
Wordpress accessibility enhancementsTed Drake
 
WordPress for Business Owners
WordPress for Business OwnersWordPress for Business Owners
WordPress for Business OwnersNick Armstrong
 
E portfolio's guide presentation
E portfolio's guide presentationE portfolio's guide presentation
E portfolio's guide presentationspike21
 
HTML5 and jQuery for Flex Developers
HTML5 and jQuery for Flex DevelopersHTML5 and jQuery for Flex Developers
HTML5 and jQuery for Flex DevelopersRyan Stewart
 
Overview of Using Wordpress for Web Site Design
Overview of Using Wordpress for Web Site DesignOverview of Using Wordpress for Web Site Design
Overview of Using Wordpress for Web Site DesignAmy Goodloe
 
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...CITE
 
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...CITE
 
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...CITE
 
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...CITE
 
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...The EduHK
 
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...CITE
 
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...CITE
 
Ci 350 tumblr
Ci 350 tumblrCi 350 tumblr
Ci 350 tumblrcooper276
 
User access manager presentation web
User access manager presentation webUser access manager presentation web
User access manager presentation webdesignfaire
 
[DCTPE2011] Drupal 7 的Fields/Views 運用
[DCTPE2011] Drupal 7 的Fields/Views 運用[DCTPE2011] Drupal 7 的Fields/Views 運用
[DCTPE2011] Drupal 7 的Fields/Views 運用Drupal Taiwan
 

Similar a Post Formats (20)

Post Type Formats
Post Type FormatsPost Type Formats
Post Type Formats
 
Wordpress accessibility enhancements
Wordpress accessibility enhancementsWordpress accessibility enhancements
Wordpress accessibility enhancements
 
Wordpress accessibility enhancements
Wordpress accessibility enhancementsWordpress accessibility enhancements
Wordpress accessibility enhancements
 
WordPress for Business Owners
WordPress for Business OwnersWordPress for Business Owners
WordPress for Business Owners
 
E portfolio's guide presentation
E portfolio's guide presentationE portfolio's guide presentation
E portfolio's guide presentation
 
HTML5 and jQuery for Flex Developers
HTML5 and jQuery for Flex DevelopersHTML5 and jQuery for Flex Developers
HTML5 and jQuery for Flex Developers
 
Overview of Using Wordpress for Web Site Design
Overview of Using Wordpress for Web Site DesignOverview of Using Wordpress for Web Site Design
Overview of Using Wordpress for Web Site Design
 
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
 
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
 
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
 
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
 
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
 
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
 
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
Hosting a dynamic blog - a paradigm shift of collaborative knowledge construc...
 
Ci 350 tumblr ci 350
Ci 350   tumblr ci 350Ci 350   tumblr ci 350
Ci 350 tumblr ci 350
 
Web 2.0
Web 2.0Web 2.0
Web 2.0
 
Ci 350 tumblr
Ci 350 tumblrCi 350 tumblr
Ci 350 tumblr
 
Joomla Templates101
Joomla Templates101Joomla Templates101
Joomla Templates101
 
User access manager presentation web
User access manager presentation webUser access manager presentation web
User access manager presentation web
 
[DCTPE2011] Drupal 7 的Fields/Views 運用
[DCTPE2011] Drupal 7 的Fields/Views 運用[DCTPE2011] Drupal 7 的Fields/Views 運用
[DCTPE2011] Drupal 7 的Fields/Views 運用
 

Último

Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Último (20)

Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Post Formats

  • 1. POST FORMATS a new 3.1 feature Wednesday, April 13, 2011
  • 2. HI, I’M ALISON i’ve worked with wordpress for last 5 years or so. i’m big on front-end design, UI, etc twitter: @alisonmf site: alisonfoxall.com Wednesday, April 13, 2011
  • 3. 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. New formats cannot be introduced by themes nor even plugins. The standardization of this list provides both compatibility between numerous themes and an avenue for external blogging tools to access to this feature in a consistent fashion. In short, with a theme that supports Post Formats, a blogger can change how each post looks by choosing a Post Format from a radio-button list. POST FORMATS as defined in the Codex http://codex.wordpress.org/Post_Formats Wednesday, April 13, 2011
  • 4. WHAT? what is this term? Wednesday, April 13, 2011
  • 5. TUMBLR-STYLE POSTS same blog, posts formatted in different ways Wednesday, April 13, 2011
  • 8. post with only a link (top) & post as an aside (bottom) Wednesday, April 13, 2011
  • 10. example of a chat in tumblr Wednesday, April 13, 2011
  • 11. OK, COOL. but couldn’t we do this already before with custom post types or custom taxonomies? Wednesday, April 13, 2011
  • 12. STANDARDS, MY FRIEND ■ aside - Typically styled without a title. Similar to a Facebook note update. ■ gallery - A gallery of images. Post will likely contain a gallery shortcode and will have image attachments. ■ link - A link to another site. Themes may wish to use the first <a href=””> tag in the post content as the external link for that post. An alternative approach could be if the post consists only of a URL, then that will be the URL and the title (post_title) will be the name attached to the anchor for it. ■ image - A single image. The first <img /> tag in the post could be considered the image. Alternatively, if the post consists only of a URL, that will be the image URL and the title of the post (post_title) will be the title attribute for the image. ■ quote - A quotation. Probably will contain a blockquote holding the quote content. Alternatively, the quote may be just the content, with the source/author being the title. ■ status - A short status update, similar to a Twitter status update. ■ video - A single video. The first <video /> tag or object/embed in the post content could be considered the video. Alternatively, if the post consists only of a URL, that will be the video URL. May also contain the video as an attachment to the post, if video support is enabled on the blog (like via a plugin). ■ audio - An audio file. Could be used for Podcasting. ■ chat - A chat transcript http://codex.wordpress.org/Post_Formats Wednesday, April 13, 2011
  • 13. POST TYPES VS. POST FORMATS what’s the difference? well, what’s the difference between advertising and marketing? Wednesday, April 13, 2011
  • 14. REMEMBER: with any custom post types, custom taxonomies, and post formats, one thing to realize: THIS IS THEME DEVELOPMENT! these features are activated at the theme level, meaning that switching from theme to theme you WILL lose front-end functionality. Wednesday, April 13, 2011
  • 15.  add_theme_support(  'post-­‐formats',  array(  'aside',  'status'  )  );    add_post_type_support(  'page',  'post-­‐formats'  ); ADDING SUPPORT is as easy as adding menu support. throw this in your functions.php file of your theme folder. Wednesday, April 13, 2011
  • 16. USAGE it’s activated on my theme, now how do I style it all? Wednesday, April 13, 2011
  • 17. 3 WAYS 1. conditionals 2. CSS level 3. template parts Wednesday, April 13, 2011
  • 18. CONDITIONALS while ( the_loop() ): if ( has_post_format( 'gallery' ) ) : // big block of HTML to format a gallery post elseif ( has_post_format( 'video' ) ) : // big block of similar HTML to format a video post elseif ( has_post_format( 'image' ) ) : // big block of similar HTML to format an image post elseif ( has_post_format( 'aside' ) ) : // big block of similar HTML to format an aside else : // big block of similar HTML to format other post endif; endwhile; holy toledo! Wednesday, April 13, 2011
  • 19. CSS LEVEL .format-­‐status  h2  {display:  none;} .format-­‐status  p  {text-­‐decoration:underline;} unable to manipulate markup. easy fix for a few things. Wednesday, April 13, 2011
  • 20. TEMPLATE PARTS division in files (like custom pages) while ( the_loop() ): get_template_part( 'format', get_post_format() ); endwhile; http://dougal.gunters.org/blog/2010/12/10/smarter-post-formats Wednesday, April 13, 2011