Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
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
 Widg...
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 locatio...
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:
f...
Extending menus
 Custom Nav Walker Class
 Show the description field
 Show featured images from posts/pages
 Access ot...
Post types, or rather, content
types
 Posts and pages are both post types
 As are attachments
 WordPress is built on it...
What problem do
they solve?
 Things that are neither posts nor pages
 Forums – bbPress plugin
 Properties
 Events
 St...
Register the hell out
of that post type
add_action('init', 'codex_custom_init');
function codex_custom_init() {
register_p...
You can always cheat
 Themergency custom post type generator
 http://themergency.com/generators/wordpress-custom-post-ty...
The post type admin
Modifying the
edit screen
Use the
metabox API
to add/remove
or reorder
metaboxes.
Example:
Blobs plugin
http://codex.wordp...
Metaboxes
add_meta_box( $id, $title, $callback, $post_type, $context, $priority,
$callback_args );
 $callback is a the na...
Metaboxes
 Provide user friendly alternatives to custom
fields
 Server side validation for custom fields eg.
sanitize_ti...
More cheating
 Lots of tutorials out there
 http://www.netmagazine.com/tutorials/user-
friendly-custom-fields-meta-boxes...
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
 R...
A widget it has got
Widget
areas on
interconnecti
t.com make
up the home
page and
footer
section
Page widget (+ jQuery)
Te...
Making sidebars
 register_sidebar( $args );
 Can be done programmatically
 Widget area per category, per page etc...
 ...
Post formats
 Differentiate content within a post type
 Think tumblr without the threat of tumbeasts
 Portable between ...
Post formats
 Supported formats: Aside, Gallery, Link, Image,
Quote, Status, Video, Audio, Chat
add_theme_support( 'post-...
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...
And it’s goodnight from him
Thanks for listening
Robert O’Rourke
http://sanchothefat.com
@sanchothefat
Upcoming SlideShare
Loading in …5
×

How to content manage everything

3,687 views

Published on

A short presentation about the new features in WordPress 3.1 and how they let you control every aspect of a site's content from the admin area including menus, widgets, post types and post formats.

Published in: Technology
  • Be the first to comment

How to content manage everything

  1. 1. Making the most of WordPress.
  2. 2. Where does the time go?  Static content sucks  It takes time to maintain  You’ve got better things to do
  3. 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. 4. Mmmmenus Lists of links really are everywhere on websites. Ever hand- coded one? Yeah, me too...
  5. 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
  6. 6. How-to-menu
  7. 7. How-to-menu
  8. 8. How-to-menu Adding links Check the boxes... Click “Add to menu”.
  9. 9. How-to-menu
  10. 10. How-to-menu
  11. 11. How-to-menu
  12. 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. 13. Extending menus  Custom Nav Walker Class  Show the description field  Show featured images from posts/pages  Access other page/post custom fields
  14. 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. 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. 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. 17. You can always cheat  Themergency custom post type generator  http://themergency.com/generators/wordpress-custom-post-types/
  18. 18. The post type admin
  19. 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. 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. 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. 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/
  23. 23. Example: Flickr Gallery
  24. 24. Example: Landing Pages
  25. 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. 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. 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. 28. Post formats  Differentiate content within a post type  Think tumblr without the threat of tumbeasts  Portable between themes  Custom layouts for posts
  29. 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. 30. There can be only one
  31. 31. Twentyten theme gallery post format
  32. 32. Tumblr style themes Auld Wumblr Shelf
  33. 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. 34. And it’s goodnight from him Thanks for listening Robert O’Rourke http://sanchothefat.com @sanchothefat

×