Chris W. Smith

  • About Me
    • Past Work
  • Tools
  • Blog
  • Contact

WordPress – Beyond Blogging

August 7, 2010 By Chris Smith Leave a Comment

Using WordPress as a CMS

Frameworks

  • Rapid Development
  • Reusable Code
  • Thesis for simple stuff, Genesis for more complex sites.
  • In Thesis, custom loops are bad.
  • Custom taxonomies and BuddyPress would great with Genesis.
  • Core theme and child themes – Core can update function without messing with child theme’s form.

Custom Post Types

  • Job Listings, Products, Portfolio Items
  • Create Post Type themes for each different type.
  • Custom taxonomies can refine where contain is and should be located.

Sidebars

  • Useful, but often overused.
  • Use only where content should repeat on all pages.

Multiple Content Areas

  • WordPress is limited to one content area.
  • Can retool unused header tags to force content into new div.

Filed Under: Wordcamp - Houston, WordPress Tagged With: wordcamp houston, wordpress

Using Proper WordPress Conventions

August 7, 2010 By Chris Smith Leave a Comment

Coding Standards

  • Always use single quotes, never double quotes
  • Vertical space is poetry; curly braces on same line.
  • Use whitespace for readability.

Avoid Raw SQL

  • Use $wpdb object
  • Use $wpdb->prepare() if SQL is needed.
  • Use existing table if possible instead of custom tables.
  • prepare() method handles santization and quotes. No reason not to use it.

Use the esc_* API

  • Provides sanitization against XSS and SQL injection attacks.
  • esc_html(), esc_attr(), esc_js(), esc_url() – uses are obvious.
  • Trust no arbitrary data, even your own.

Use Nonces (Number Only Used Once)

  • Use for single-use action (forms)
  • Add wp_nonce_field() to all forms

Use The Shortcode API

  • Allows javascripts/embeds in post safely.
  • Functions: shortcode_atts() and add_shortcode()
  • Shortcodes are wave of the future for WP.

Filed Under: Wordcamp - Houston, WordPress Tagged With: wordcamp houston, wordpress

WordPress – Theme Development

August 7, 2010 By Chris Smith Leave a Comment

Exploring Theme Development

Planning Your Build

Know what you want before pen hits paper.
Create site map/outline so you know what page templates you need.

Single project or reusable theme?
Submitting theme to WP theme repository will have certain rules you need to follow. Certain pages in theme, copyright issues, etc.

What do you want your theme to do? Is WP even right for the project?
You can do anything PHP can do, but not all things are good projects for WordPress (ecommerce).

Wireframe

Use boxes to show your content areas.

No Page Left Behind

  • Know which page types you will want to use so you can build for them ahead of time.
  • Public Release? You should include default template files.

Development Environment

Physical Environment

  • Code is poetry, workspace should be clean and tidy.
  • Avoid distraction
  • Respect your sanity, or lack thereof. Take plenty of breaks.

Essential Tools

  • A good text editor is essential.
  • FTP client for uploading/downloading
  • Image editors (Photoshop, GIMP)
  • Utilities (code snippet storage, digital color meter, Firebug, on-screen ruler, Web Developer in Firefox, MeasureIt)

Hosting

  • Mimic anticipated deployment environment
  • Local hosting vs. remote hosting

Local Filesystem Efficiency

  • Organize your files – common plugins, icons, textures, etc.
  • Become a packrat; you never know when you might need it again.

Frameworks

  • Framework is a almost-blank canvas. Functions sans styles.
  • They are a huge time saver to help you not repeat code.

Options

  • Build your own
  • Popular frameworks – Thematic, Sandbox, Hybrid
  • Be careful of upgrades killing your theme. Save as a completely new theme, or do merges via repository.

Development

  • Template Tags in Codex covers frequently used tags in theme development. Plugins use Function References.
  • Template Development Standards is important for getting into public theme repository.
  • Child theme are less strict since already based on parent theme.

Theme Unit Test

  • Theme Unit Test will test theme with every possible type of data in WordPress template.

Filed Under: Wordcamp - Houston, WordPress Tagged With: wordcamp houston, wordpress

WordPress – Optimizing Performance

August 7, 2010 By Chris Smith Leave a Comment

Why Performance Matters:

  • User Experience
  • Search Rankings
  • Server Resources/Costs
  • Digg/Slashdot Effect

Front End Performance

  1. Fewer Requests
  2. Progressive Rendering
  3. Concurrent Downloads
  4. Expires Headers
  5. Reduce cookie size or use cookieless subdomains.

Performance Grading
Use YSlow  and Google PageSpeed to grade performance, figure out expires headers to use, find opportunities to make fewer HTTP requests and DNS lookups. Lots of other things to check, each service has strengths.

Use CSS Sprites
Uses fewer file requests. Spriteme does a lot of work for you; renders changes in browsers and gives you changes to CSS.

Combine and Minify External JS and CSS
W3 Total Cache does this for you. Be careful of JS that needs to load in order.

Death by Social Media Buttons
Most are going to kill performance because of page waiting to load external buttons/javascript.

Waterfall Effect
CSS at top and JS at the bottom. JS in <head> causes page redraw issues on slow downloads.

jQuery
Use Google CDN for jQuery needs.

.htaccess
Leverage browser caching with Expires Headers and Proxy Cache Control Headers. Enable gzip compression for reduced file sizes. Set Expires times farther ahead when possible.

Caching WordPress

  • Static Page Caching – not good for dynamic content
  • OpCode and Object Caching with APC, eAccelerator, X-Cache – Best Performance, not for shared hosts, works best with mod_fastcgi (cPanel uses older style)
  • Memcached Server with PECL memcache
  • WordPress Transient API – small snippets stored in DB that will frequently expire

Static Page Caching + Opcode with W3-Total Cache and APC Object-Cache plugins. Does not work with Zend Optimizer.

eAccelerator – Most stable. Easy to install, easy to configure, Caches PHP and can be used as Zend extension.

Memcached + Memcached server – Persists across multiple servers. Cache stored in memory. Good to quickly scale hardware.

Memcached + WordPress Transient API – WordPress will store the cache in memory if Memcache is installed. Stores small fragments of data that should expire quickly in MySQL. Good for things like social plugin streams.

Server Optimization

Traditional LAMP Stack – old, reliable, but slow.

Linux-nGinix(reverse proxy)-Apache-PHP (LEAP) – Fast, lightweight. Sends static content from nginix, lets Apache/PHP do the heavy stuff.

Matt – “Almost every blog can be fast enough with built-in WP-Cache plugin.”

Filed Under: Wordcamp - Houston, WordPress Tagged With: wordcamp houston, wordpress

WordPress 3.0 – What’s New

August 7, 2010 By Chris Smith Leave a Comment

New Stuff:
the_shortlink() – Short URLs
Gives http://wp.me shortlink.

get_template_part() – including template files
New Way: get_template_part(file.php)

comment_form() – includes comment form
Replaces entire

comments. Labels changed using $args array in function call. Documented in Codex.

wp_nav_menu() – include nav menu
wp_nav_menu(“menu=Main”)
wp_nav_menu(“fallback_cb=wp_list_categories”) – fallback menu before user definition
Needed in function.php: add_theme_support(“nav_menus”);

New theme types:
single-content-type.php
author.php
author-id.php
author-nickname.php
category-slug.php

Custom Post Types:
register_post_type
“supports” array can define features of custom post
query_posts(‘post_type=post,posttype”); – Adds to existing Loop.
Custom Post Type Feeds:
/?feed=rss2&post_type=posttype
Custom Post Type UI plugin manages all of this

Create custom page template to list custom post types.

Multisite/WPMU
Requirements – subdomains: wildcard DNS
Requirements – Subdirectories: .htaccess
Supports domains with Domain Mapping plugin.

Went Away:
Option For Global Tags
Misc. Settings Page
Plugin auto-importers

Questions – Stephanie Leary
@sleary
http;//www.sillybean.net
www.slideshare.net/stephanieleary

Filed Under: Wordcamp - Houston, WordPress Tagged With: wordcamp houston, wordpress

  • « Previous Page
  • 1
  • …
  • 8
  • 9
  • 10
  • 11
  • Next Page »

Latest Posts

  • Keyword Research Using Python, RAKE, and Support Chat Transcripts June 16, 2017
  • No Title June 16, 2017
  • Premixed Old Fashioneds May 3, 2017
  • Downstairs Bathroom Renovation March 8, 2017
  • Testing Android January 9, 2017
  • About Me
  • Tools
  • Blog
  • Contact

Copyright © 2022 · Built with the Genesis Framework on WordPress