WordPress Tips and Tricks (DFW Meetup)


Published on

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • If you’ve been using WordPress for a while, you might not have noticed the screen options that were added a few versions ago. You can change the number of posts or pages shown per page in the Edit screens, and you can hide some of the columns if you like.\n
  • On the menu screen, the screen options allows you to show things that are normally hidden, like custom post types and taxonomies.\n
  • On the Dashboard, the screen options let you choose the number of columns your widgets are displayed in, and you can turn off individual widgets.\n
  • \n
  • The bulk edit feature is also easy to overlook. Check off several posts in the Edit screen, then choose “Edit” from the Bulk Actions dropdown. You’ll be able to edit all the attributes of the posts: categories, tags, comment/trackback settings, publication status, and sticky status. You won’t be able to edit things that are naturally unique to each post, like the title and date.\n
  • \n
  • Did you know there’s a members-only content feature built right into WordPress? It’s a little buggy, which is probably why it’s not more well-known. If you change a post or page to privately published, only logged-in users who can see private posts and pages will be able to see it.\n
  • This is Justin Tadlock’s Members plugin. Among other things, you can choose which roles can edit or read private posts and pages -- or you can create a whole new role for that purpose.\n
  • the_shortlink() is a new function in 3.0. It lets you print a shorter permalink for your post in your template file for readers to use. If you have the WordPress Stats plugin installed, you’ll see wp.me links (although you can turn that off in the plugin’s settings). If not, you’ll see the default permalink structure (example.com/?p=123), which always works no matter what permalink structure you’ve chosen.\n
  • \n
  • \n
  • \n
  • The Incoming Links and the two WordPress news Dashboard widgets are just RSS readers. Click “configure” in the upper right corner of each widget, and you’ll be able to change the RSS feed that’s shown.\n
  • \n
  • Type options.php into your address bar (example.com/wp-admin/options.php) and you’ll get this alphabetized listing of all the options stored in your wp_options database table. Some won’t be editable -- if they’re stored as arrays, you’ll just see “Serialized data” -- but the rest can be changed here. Be careful with this!\n
  • You can edit serialized options by changing the database fields directly. Copy the serialized array (shown here in the row with the ID 10390) and paste it into the Online PHP Unserializer at blog.tanist.co.uk. This tool will convert the serialized array to a more familiar array printout. You can then make changes and re-serialize the array to store it back in the database.\n
  • \n
  • WordPress automatically generates feeds for just about everything. Most of the time, the feeds for posts and comments are the only ones you see. For anything else, just add /feed to the URL and see what happens! You can get feeds for categories, tags, combinations of tags...\n
  • ... individual authors’ posts, post types (including pages!), taxonomy terms, and even search terms.\n
  • This is where you’ll have to get your hands dirty with code. Filters allow you to change the way content is handled or displayed in WordPress sites.\n
  • For example, you can easily allow users to use shortcodes in text widgets by adding these two lines to your functions.php file.\n
  • It’s also easy to automatically list child pages on a parent page with empty content using this filter. (See my website for alternatives using shortcodes and template tags.)\n
  • This filter alters the contact fields that are shown in user profiles. Here, I’ve removed the three IM fields and added Twitter, a phone number, and a job title.\n
  • Here’s how the new contact fields appear.\n
  • With the new fields in place, it’s easy to build a robust user directory. (See this URL for details on limiting the directory to certain roles.)\n
  • This is where you’ll have to get your hands dirty with code. Filters allow you to change the way content is handled or displayed in WordPress sites.\n
  • \n
  • Use the Exploit Scanner plugin after you’ve installed, but before you’ve enabled, a new theme or plugin. This was written by several of the core developers and it looks for a lot of the problems they see in things rejected from the official repositories.\n
  • Any questions before I move on to 3.1?\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • WordPress Tips and Tricks (DFW Meetup)

    1. Tips and TricksStephanie Leary sillybean.net @sleary
    2. Who am I?• sillybean.net• uwc.tamu.edu• @sleary• slideshare.net/ stephanieleary
    3. Importing
    4. I’ve imported from...• Blogger • Joomla• Movable Type • Drupal• Textpattern • Twitter• LiveJournal • Gallery2• WordPress.com • Delicious• CSV files • HTML files
    5. Uncommon Importshttp://codex.wordpress.org/Importing_Content
    6. HTML Import
    7. Secrets ofHappy Importing
    8. Preparation• Back up• Prepare to undo• Import on development server • Or turn on maintenance mode• Turn off crossposting plugins• Use absolute URLs for linked files
    9. Plugins• DB Backup http://wordpress.org/extend/plugins/wp-db-backup/• Mass Page Remover http://wordpress.org/extend/plugins/mass-page-remover/• WordPress Reset http://wordpress.org/extend/plugins/wordpress-reset/• Maintenance Mode http://wordpress.org/extend/plugins/maintenance-mode/
    10. WordPress export• Posts, pages, comments, authors• Uploads optional• No settings• No menus in 3.0 (fixed in 3.1)• Category slug issues (fixed in 3.1)• Skips users with no posts
    11. Uncommon imports• Twitter http://wordpress.org/extend/plugins/twitter-importer/• Delicious http://wordpress.org/extend/plugins/delicious-xml-importer/• Gallery2 http://wordpress.org/extend/plugins/gallery2-importer/• HTML http://wordpress.org/extend/plugins/import-html-pages/
    12. Uncommon imports• Joomla/Mambo • 1.0 to WP 2.7x: http://tinyurl.com/joom2wp • 1.5 to WP 3.0x: http://wordpress.org/extend/plugins/ joomla-15-importer/• Drupal • 6.x to WP 2.7x: http://tinyurl.com/dru6wp2 • 5.x to WP 2.7x: http://tinyurl.com/dru5wp2• CSV http://wordpress.org/extend/plugins/csv-importer/
    13. After importing• Search & Replace http://wordpress.org/extend/plugins/search-and-replace/• Redirection http://wordpress.org/extend/plugins/redirection/• Add Linked Images to Gallery http://wordpress.org/extend/plugins/add-linked-images- to-gallery-v01/
    14. ?
    15. Screen Options
    16. Bulk Edit
    17. Private Status
    18. Short Links the_shortlink();
    19. Good Permalinks• Include any numeric code• DON’T use: /%category%/%postname%/• Why? http://dougal.gunters.org/?p=1431
    20. Dashboard Feeds
    21. Options.php
    22. http://blog.tanist.co.uk/files/unserialize/
    23. Hidden Feeds
    24. Feed Default URL Clean URL /?feed=rss2 /feed Basic /?feed=atom /feed/atom /?feed=comments-rss2 /comments/feed Comments /?feed=comments-atom /comments/feed/atom Category /?feed=rss2&cat=1 /category/news/feed(ID: 1, slug: news) /?feed=atom&cat=1 /category/news/feed/atom Tag /?feed=rss2&tag=book /tag/book/feed (slug: book) /?feed=atom&tag=book /tag/book/feed/atom Tags /?feed=rss2&tag=book+dvd /tag/book+dvd/feed(slugs: book, dvd) /?feed=atom&tag=book+dvd /tag/book+dvd/feed/atom
    25. Feed Default URL Clean URL Author /?feed=rss2&author=2 /author/joe/feed (ID: 2,nickname: Joe) /?feed=atom&author=2 /author/joe/feed/atomPost Type /?feed=rss2&post_type=page /feed/?post_type=page(page; course) /?feed=atom&post_type=course /feed/atom/?post_type=courseTaxonomy /?feed=rss2&genre=mystery /genre/mystery/feed (genre: mystery) /?feed=atom&genre=mystery /genre/mystery/feed/atom Search /?feed=rss2&s=wordpress /feed/?s=wordpress Term /?feed=atom&s=wordpress /feed/atom/?s=wordpress (wordpress)
    26. Filters
    27. Shortcodes in Widgets add_filter( widget_text, shortcode_unautop); add_filter( widget_text, do_shortcode); http://sillybean.net/?p=2719
    28. List Child Pagesfunction append_child_pages( $content ) { $children = ; if ( is_page() && (empty( $content )) ) { global $post; $children = <ul class="childpages"> .wp_list_pages(echo=0&title_li=&child_of=.$post->ID) .</ul>; } return $content.$children;}add_filter( the_content , append_child_pages ); http://sillybean.net/?p=5246
    29. User Contact Infofunction change_contactmethod( $contactmethods ) { // Add some fields $contactmethods[twitter] = Twitter Name (no @); $contactmethods[phone] = Phone Number; $contactmethods[title] = Title; // Remove AIM, Yahoo IM, Google Talk/Jabber unset($contactmethods[aim]); unset($contactmethods[yim]); unset($contactmethods[jabber]); // make it go! return $contactmethods;}add_filter(user_contactmethods,change_contactmethod,10,1); http://sillybean.net/?p=2714
    30. http://sillybean.net/?p=2715
    31. EvaluatingThemes & Plugins
    32. Evilness• base64()• eval()• links you can’t remove• etc.• get things from wordpress.org!
    33. Exploit Scannerhttp://wordpress.org/extend/plugins/exploit-scanner/
    34. ?
    35. New in 3.1• admin bar• internal links• network admin• sortable columns• better theme search
    36. New in 3.1• post formats• custom post type archives• hidden meta boxes• advanced taxonomy queries http://otto42.com/81
    37. For Developers• user_can• get_users• has_term• single_term_title
    38. For Developers• get_ancestors• set_post_thumbnail• esc_textarea• submit_button
    39. Thank you. Stephanie Leary sillybean.net @sleary