SlideShare une entreprise Scribd logo
1  sur  34
Making the most of WordPress.
Where does the
time go?
 Static content sucks
 It takes time to maintain
 You’ve got better things to do
There’s a feature
for that
 My aim is to give you an idea of what is
possible with WordPress.
 Menus
 Post types
 Widgets
 Post formats
Mmmmenus
Lists of links
really are
everywhere
on websites.
Ever hand-
coded one?
Yeah, me
too...
Mmmmenus
 Never hand code a menu again
 Don’t worry about changing URLs
 CSS Hooks a-plenty me hearties
 Theme locations for different menus
 Menu widget
How-to-menu
How-to-menu
How-to-menu
Adding links
Check the boxes...
Click “Add to menu”.
How-to-menu
How-to-menu
How-to-menu
Theme locations
“Primary Navigation” is the
theme location and “My
menu” is a menu selected
from the dropdown.
The code:
functions.php:
register_nav_menu( 'primary', 'My Menu' );
header.php
wp_nav_menu( array( 'theme_location' => 'primary' ) );
Further reading:
http://codex.wordpress.org/Function_Reference/wp_nav_menu
Extending menus
 Custom Nav Walker Class
 Show the description field
 Show featured images from posts/pages
 Access other page/post custom fields
Post types, or rather, content
types
 Posts and pages are both post types
 As are attachments
 WordPress is built on its own API
 The same API is available to theme & plugin
developers
What problem do
they solve?
 Things that are neither posts nor pages
 Forums – bbPress plugin
 Properties
 Events
 Static blocks
 Landing pages
 Other applications
Register the hell out
of that post type
add_action('init', 'codex_custom_init');
function codex_custom_init() {
register_post_type('book', array(
'labels' => $labels,
'show_ui' => true,
'show_in_menu' => true,
'rewrite' => true,
'capability_type' => 'post',
'has_archive' => true,
'supports' => array('title','editor','thumbnail')
) );
}
You can always cheat
 Themergency custom post type generator
 http://themergency.com/generators/wordpress-custom-post-types/
The post type admin
Modifying the
edit screen
Use the
metabox API
to add/remove
or reorder
metaboxes.
Example:
Blobs plugin
http://codex.wordpress.o
rg/Function_Reference/a
dd_meta_box
Metaboxes
add_meta_box( $id, $title, $callback, $post_type, $context, $priority,
$callback_args );
 $callback is a the name of a function that
displays the content eg. Form fields
 $context determines where the box appears eg.
‘side’ or ‘normal’
 $priority allows you to control the order boxes
appear in eg. ‘high’ or ‘low’
Metaboxes
 Provide user friendly alternatives to custom
fields
 Server side validation for custom fields eg.
sanitize_title_with_dashes( $_POST[‘my_field’] );
 Use the ‘save_post’ action
 update_post_meta($post_id, $meta_key, $meta_value);
 Accessing post meta
 get_post_meta($post_id, $key, $single);
 get_post_custom();
More cheating
 Lots of tutorials out there
 http://www.netmagazine.com/tutorials/user-
friendly-custom-fields-meta-boxes-wordpress
 Or if you’re not into coding
 http://wordpress.org/extend/plugins/more-fields/
Example:
Flickr
Gallery
Example:
Landing
Pages
Its got a widget
 Typically in a sidebar
 Can be anywhere in a theme – “Widget areas”
 Many plugins provide widgets
 Rapid prototyping of information architecture
A widget it has got
Widget
areas on
interconnecti
t.com make
up the home
page and
footer
section
Page widget (+ jQuery)
Text Widget
Posts widgets
Authors widget
Archive widget
Further reading:
http://codex.wordpress.org/Widgets_A
PI
Making sidebars
 register_sidebar( $args );
 Can be done programmatically
 Widget area per category, per page etc...
 Could even use a custom menu walker to
show widgets in a menu – mega menus!
Further Reading:
http://justintadlock.com/archives/2010/11/08/sidebars-in-wordpress
Post formats
 Differentiate content within a post type
 Think tumblr without the threat of tumbeasts
 Portable between themes
 Custom layouts for posts
Post formats
 Supported formats: Aside, Gallery, Link, Image,
Quote, Status, Video, Audio, Chat
add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );
 Per post type:
add_post_type_support( $post_type, 'post-formats' );
 In the loop:
has_post_format( $format );
There can be only one
Twentyten theme
gallery post format
Tumblr style themes
Auld
Wumblr
Shelf
In summary
 Menus take the pain out of site navigation
 Post types make WP suitable for many
applications
 Widgets make it easy to refine information
architecture
 Post formats are frickin cool
And it’s goodnight from him
Thanks for listening
Robert O’Rourke
http://sanchothefat.com
@sanchothefat

Contenu connexe

Tendances

Best Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStart
Best Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStartBest Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStart
Best Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStartScott DeLoach
 
Developing Context-sensitive Help for Web-based Applications - Scott DeLoach,...
Developing Context-sensitive Help for Web-based Applications - Scott DeLoach,...Developing Context-sensitive Help for Web-based Applications - Scott DeLoach,...
Developing Context-sensitive Help for Web-based Applications - Scott DeLoach,...Scott DeLoach
 
Ves localshop
Ves localshopVes localshop
Ves localshopAlena Dao
 
Dress Your WordPress with Child Themes
Dress Your WordPress with Child ThemesDress Your WordPress with Child Themes
Dress Your WordPress with Child ThemesLaurie M. Rauch
 
Custom content types & custom taxonomies in wordpress
Custom content types & custom taxonomies in wordpressCustom content types & custom taxonomies in wordpress
Custom content types & custom taxonomies in wordpressstimasoft
 
Codigo html revista
Codigo html revistaCodigo html revista
Codigo html revistaMRFREDDYSAN
 

Tendances (8)

Best Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStart
Best Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStartBest Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStart
Best Practices for Embedded UA - WritersUA 2012, Scott DeLoach, ClickStart
 
Developing Context-sensitive Help for Web-based Applications - Scott DeLoach,...
Developing Context-sensitive Help for Web-based Applications - Scott DeLoach,...Developing Context-sensitive Help for Web-based Applications - Scott DeLoach,...
Developing Context-sensitive Help for Web-based Applications - Scott DeLoach,...
 
Ves localshop
Ves localshopVes localshop
Ves localshop
 
Session handling in php
Session handling in phpSession handling in php
Session handling in php
 
Dress Your WordPress with Child Themes
Dress Your WordPress with Child ThemesDress Your WordPress with Child Themes
Dress Your WordPress with Child Themes
 
Intro To Sammy
Intro To SammyIntro To Sammy
Intro To Sammy
 
Custom content types & custom taxonomies in wordpress
Custom content types & custom taxonomies in wordpressCustom content types & custom taxonomies in wordpress
Custom content types & custom taxonomies in wordpress
 
Codigo html revista
Codigo html revistaCodigo html revista
Codigo html revista
 

Similaire à How to content manage everything

Building Potent WordPress Websites
Building Potent WordPress WebsitesBuilding Potent WordPress Websites
Building Potent WordPress WebsitesKyle Cearley
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme EnlightenmentAmanda Giles
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017Amanda Giles
 
Build WordPress themes like a heavyweight - WordCamp Lancaster 2013
Build WordPress themes like a heavyweight - WordCamp Lancaster 2013Build WordPress themes like a heavyweight - WordCamp Lancaster 2013
Build WordPress themes like a heavyweight - WordCamp Lancaster 2013Jonny Allbut
 
WordPress HTML, CSS & Child Themes
WordPress HTML, CSS & Child ThemesWordPress HTML, CSS & Child Themes
WordPress HTML, CSS & Child ThemesMichelle Ames
 
SMACSS Your Sass Up
SMACSS Your Sass UpSMACSS Your Sass Up
SMACSS Your Sass UpMina Markham
 
Writing your own WordPress themes and plugins
Writing your own WordPress themes and pluginsWriting your own WordPress themes and plugins
Writing your own WordPress themes and pluginsStephanie Wells
 
Wordpress workflow for an agency world
Wordpress workflow for an agency worldWordpress workflow for an agency world
Wordpress workflow for an agency worldChris Lowe
 
Search in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize itSearch in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize itOtto Kekäläinen
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 Evan Mullins
 
Geek Moot '09 -- Smarty 101
Geek Moot '09 -- Smarty 101Geek Moot '09 -- Smarty 101
Geek Moot '09 -- Smarty 101Ted Kulp
 
Getting Started With WordPress Development
Getting Started With WordPress DevelopmentGetting Started With WordPress Development
Getting Started With WordPress DevelopmentAndy Brudtkuhl
 
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...Evan Mullins
 
WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015
WP 201   Custom Post Types - Custom Fields - WordCamp Columbus 2015WP 201   Custom Post Types - Custom Fields - WordCamp Columbus 2015
WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015Joe Querin
 
WordCamp Manchester 2016 - Making WordPress Menus Smarter
WordCamp Manchester 2016 - Making WordPress Menus SmarterWordCamp Manchester 2016 - Making WordPress Menus Smarter
WordCamp Manchester 2016 - Making WordPress Menus SmarterJonny Allbut
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPressNile Flores
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...LinnAlexandra
 

Similaire à How to content manage everything (20)

Building Potent WordPress Websites
Building Potent WordPress WebsitesBuilding Potent WordPress Websites
Building Potent WordPress Websites
 
The Way to Theme Enlightenment
The Way to Theme EnlightenmentThe Way to Theme Enlightenment
The Way to Theme Enlightenment
 
Custom Fields & Custom Metaboxes Overview
Custom Fields & Custom Metaboxes OverviewCustom Fields & Custom Metaboxes Overview
Custom Fields & Custom Metaboxes Overview
 
The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017The Way to Theme Enlightenment 2017
The Way to Theme Enlightenment 2017
 
Build WordPress themes like a heavyweight - WordCamp Lancaster 2013
Build WordPress themes like a heavyweight - WordCamp Lancaster 2013Build WordPress themes like a heavyweight - WordCamp Lancaster 2013
Build WordPress themes like a heavyweight - WordCamp Lancaster 2013
 
WordPress HTML, CSS & Child Themes
WordPress HTML, CSS & Child ThemesWordPress HTML, CSS & Child Themes
WordPress HTML, CSS & Child Themes
 
SMACSS Your Sass Up
SMACSS Your Sass UpSMACSS Your Sass Up
SMACSS Your Sass Up
 
Writing your own WordPress themes and plugins
Writing your own WordPress themes and pluginsWriting your own WordPress themes and plugins
Writing your own WordPress themes and plugins
 
WordCamp Praga 2015
WordCamp Praga 2015WordCamp Praga 2015
WordCamp Praga 2015
 
Wordpress workflow for an agency world
Wordpress workflow for an agency worldWordpress workflow for an agency world
Wordpress workflow for an agency world
 
Search in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize itSearch in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize it
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017 So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
 
Geek Moot '09 -- Smarty 101
Geek Moot '09 -- Smarty 101Geek Moot '09 -- Smarty 101
Geek Moot '09 -- Smarty 101
 
Getting Started With WordPress Development
Getting Started With WordPress DevelopmentGetting Started With WordPress Development
Getting Started With WordPress Development
 
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
Custom post types- Choose Your Own Adventure - WordCamp Atlanta 2014 - Evan M...
 
WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015
WP 201   Custom Post Types - Custom Fields - WordCamp Columbus 2015WP 201   Custom Post Types - Custom Fields - WordCamp Columbus 2015
WP 201 Custom Post Types - Custom Fields - WordCamp Columbus 2015
 
WordPress Theming 101
WordPress Theming 101WordPress Theming 101
WordPress Theming 101
 
WordCamp Manchester 2016 - Making WordPress Menus Smarter
WordCamp Manchester 2016 - Making WordPress Menus SmarterWordCamp Manchester 2016 - Making WordPress Menus Smarter
WordCamp Manchester 2016 - Making WordPress Menus Smarter
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPress
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
 

Dernier

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 

Dernier (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 

How to content manage everything

  • 1. Making the most of WordPress.
  • 2. Where does the time go?  Static content sucks  It takes time to maintain  You’ve got better things to do
  • 3. There’s a feature for that  My aim is to give you an idea of what is possible with WordPress.  Menus  Post types  Widgets  Post formats
  • 4. Mmmmenus Lists of links really are everywhere on websites. Ever hand- coded one? Yeah, me too...
  • 5. Mmmmenus  Never hand code a menu again  Don’t worry about changing URLs  CSS Hooks a-plenty me hearties  Theme locations for different menus  Menu widget
  • 8. How-to-menu Adding links Check the boxes... Click “Add to menu”.
  • 12. Theme locations “Primary Navigation” is the theme location and “My menu” is a menu selected from the dropdown. The code: functions.php: register_nav_menu( 'primary', 'My Menu' ); header.php wp_nav_menu( array( 'theme_location' => 'primary' ) ); Further reading: http://codex.wordpress.org/Function_Reference/wp_nav_menu
  • 13. Extending menus  Custom Nav Walker Class  Show the description field  Show featured images from posts/pages  Access other page/post custom fields
  • 14. Post types, or rather, content types  Posts and pages are both post types  As are attachments  WordPress is built on its own API  The same API is available to theme & plugin developers
  • 15. What problem do they solve?  Things that are neither posts nor pages  Forums – bbPress plugin  Properties  Events  Static blocks  Landing pages  Other applications
  • 16. Register the hell out of that post type add_action('init', 'codex_custom_init'); function codex_custom_init() { register_post_type('book', array( 'labels' => $labels, 'show_ui' => true, 'show_in_menu' => true, 'rewrite' => true, 'capability_type' => 'post', 'has_archive' => true, 'supports' => array('title','editor','thumbnail') ) ); }
  • 17. You can always cheat  Themergency custom post type generator  http://themergency.com/generators/wordpress-custom-post-types/
  • 18. The post type admin
  • 19. Modifying the edit screen Use the metabox API to add/remove or reorder metaboxes. Example: Blobs plugin http://codex.wordpress.o rg/Function_Reference/a dd_meta_box
  • 20. Metaboxes add_meta_box( $id, $title, $callback, $post_type, $context, $priority, $callback_args );  $callback is a the name of a function that displays the content eg. Form fields  $context determines where the box appears eg. ‘side’ or ‘normal’  $priority allows you to control the order boxes appear in eg. ‘high’ or ‘low’
  • 21. Metaboxes  Provide user friendly alternatives to custom fields  Server side validation for custom fields eg. sanitize_title_with_dashes( $_POST[‘my_field’] );  Use the ‘save_post’ action  update_post_meta($post_id, $meta_key, $meta_value);  Accessing post meta  get_post_meta($post_id, $key, $single);  get_post_custom();
  • 22. More cheating  Lots of tutorials out there  http://www.netmagazine.com/tutorials/user- friendly-custom-fields-meta-boxes-wordpress  Or if you’re not into coding  http://wordpress.org/extend/plugins/more-fields/
  • 25. Its got a widget  Typically in a sidebar  Can be anywhere in a theme – “Widget areas”  Many plugins provide widgets  Rapid prototyping of information architecture
  • 26. A widget it has got Widget areas on interconnecti t.com make up the home page and footer section Page widget (+ jQuery) Text Widget Posts widgets Authors widget Archive widget Further reading: http://codex.wordpress.org/Widgets_A PI
  • 27. Making sidebars  register_sidebar( $args );  Can be done programmatically  Widget area per category, per page etc...  Could even use a custom menu walker to show widgets in a menu – mega menus! Further Reading: http://justintadlock.com/archives/2010/11/08/sidebars-in-wordpress
  • 28. Post formats  Differentiate content within a post type  Think tumblr without the threat of tumbeasts  Portable between themes  Custom layouts for posts
  • 29. Post formats  Supported formats: Aside, Gallery, Link, Image, Quote, Status, Video, Audio, Chat add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );  Per post type: add_post_type_support( $post_type, 'post-formats' );  In the loop: has_post_format( $format );
  • 30. There can be only one
  • 33. In summary  Menus take the pain out of site navigation  Post types make WP suitable for many applications  Widgets make it easy to refine information architecture  Post formats are frickin cool
  • 34. And it’s goodnight from him Thanks for listening Robert O’Rourke http://sanchothefat.com @sanchothefat

Notes de l'éditeur

  1. Hellos! Welcome to the presentation I will going over some of the recent advances in the WordPress core that make it much more powerful as a cms
  2. Why would you want to content manage everything? You’ve got better things to do...
  3. While I won’t be going into a huge amount of detail here I hop eto rpvide you with an overview iof what can be done. We’ll be covering Menus, Post types, Widgets and Post formats
  4. Lists of links are the bread & nutter of the web. They’re everywhere. - In the past whenusing wordpress as a cms it was an all/nothing approach to do it programmatically - Hands up who’s hand coded a menu? - Lists of links can be really simple - They can be more complex like an archive - Or super massive like on a news site
  5. Changing URLs – when moving from local to dev & back again, it just works - CSS Hooks – will see a short example - Theme Locations – place created menus within a theme – Menu widget to put links anywhere
  6. The menu admin is tied into the theme being used so you’ll find it in the Appearance dropdown - Create a menu by typing the name in the box and clicking create - So far so good -
  7. The menu admin is tied into the theme being used so you’ll find it in the Appearance dropdown Create a menu by typing the name in the box and clicking create So far so good
  8. Adding links is easy – Boxes provide a way of adding arbritrary links and also link within the site – Check the boxes and add to menu
  9. Drag & Drop Don’t forget to save changes
  10. Drag & Drop Indent to make submenus Don’t forget to save changes
  11. Screen options! Easy to miss hiding up there in the corner - Use it to show more fields than normal in the link edit box - Use it to show selection boxes on left – Links to post types and taxonomies -
  12. Theme locations are where the magic happens - They let you direct menus you’ve created to sections of the site - The code is literally that simple, although there are plenty more options, filters & hooks available -
  13. Recommend googling the top line and you’ll find good tutorials - Useful to know exactly what is possible Image below shows a menu with a custom walker. - Featured images from posts are shown at a custom image size. – Use the object_type property - Categories have a bit of extra magic to enable images – wordpress.stackexchange.com - Could even go so far as to show a widget areas for the menu items! Slightly mad but sometimes you need a mega menu
  14. Post types should really be called content types - Within wordpress posts and pages are the default post types – You can use the functions wp uses itself to add more post types
  15. Post types allow you to separate your content especially when it’s specific to what the theme or plugin needs to do. - Forums via bbPress plugin forums, topic & replies are all post types - Properties – a theme or plugin that provides a way to list properties on a website - Static blocks – Appthemes -
  16. Labels is an array of labels – too much to show here - Show ui – shows it in the admin menu – Show in menu – Show post type on menus screen -
  17. Definitely the quickest way to create the code you need - Use output in your theme’s functions.php or in your plugin.
  18. Basically the same as posts/pages admin - You can edit the table columns and filter section at the top but it’s fairly complicated – wp.stackexchange
  19. Blobs plugin – adds a simple way to create rich content boxes that can be called in the theme via shortcodes, widget or template tag - User friendly ‘custom fields’ - Example: 404 page message, no results found message, static ‘rich’ text in a sidebar
  20. So called because of how the database works - Posts table provides underlying structure - Posts can be extended with post meta -
  21. Abstraction layer on top of the custom fields box Custom fields not the most user friendly thing to rely on for clients Use metaboxes Codex is a great resource
  22. Google this stuff because there’s lots of good tuts out there - Plugins are an alternative
  23. Admin page has custom boxes for flickr gallery, user, set etc... And the id of said gallery, user or set
  24. Theme integrated with gravity forms - Metaboxes for tracking codes, extra content spaces, page layouts, gravity forms integration
  25. Widgets are an incredibly useful tool in WordPress for building up structure and IA - Lots of plugin have them like gravity forms, our weather widget, the blobs plugin, menus - Things that are the same across multiple pages but that need to be editable at a moments notice – ideally by the client/site owner
  26. Lots of types of widgets Easy to build them just follow the example and you’re away. Default widgets in default-widgets file of wp-includes
  27. The sky is the limit You can create sidebars in your init function based on existing pages/categories even menu items to make your sites hugely dynamic and flexible.
  28. A special taxonomy with an interface that only allows you to set one option - Previously used categories eg. ‘gallery’ but gets messy quickly. Also clients may accidentally place something in two cats that have custom layouts. - Was typing in tumbeasts it tried to auto-correct to FU-beasts
  29. A special taxonomy with an interface that only allows you to set one option - Previously used categories eg. ‘gallery’ but gets messy quickly. Also clients may accidentally place something in two cats that have custom layouts.
  30. Latest 2010 theme post formats
  31. Latest version of twenty theme displays gallery posts like this in a list.
  32. Auld by woothemes Wumblr by themify Shelf by thethemefoundry
  33. Menus Post types Widgets Formats
  34. Thanks for listening Any Questions?