OC WordPress Dev Meeting Notes 3/12

Did you contribute to these notes? (name - twitter name - websites)

Jason Tucker - @jasontucker   http://www.jasontucker.us  http://www.ohatdl.com

Jeff Hester @jeffhester http://www.jeffhester.net 

Jon Brown @jb510 http://www.wanderingjon.com http://www.jbrownstudios.com

Sarah W @stabitha

Who presented and on what?

• Advanced Custom Fields Plugin ( Suzette Franck )

• How to setup theme options ( Gregg Franklin )

• JavaScript in WordPress ( Jeffrey Zinn )

• Photocrati theme ( Anton Vasilescu )

Presentation notes:

Advanced Custom Fields Plugin by Elliot Condon, 5 stars, 270 ratings

Suzette Franck

http://wordpress.org/extend/plugins/advanced-custom-fields/ 

http://advancedcustomfields.com - documentation, add-ons, support

Works well with custom post types, allowing you to create and use custom fields.

Settings are not necessary, but useful for add-ons(?) to this plugin

Start by creating field groups (i.e. “Ingredients”)

Getting the custom fields to display is a bit trickier. You have to edit the templates.

http://beta.thinkspacegallery.com/ provides an example. Each gallery show uses a custom post type with custom fields. (Great job, Suzette!)

How to Setup Theme Options

Gregg Franklin

Desktop Server - uses XAMP, but specifically for WordPress. Sets up the database, and much, much more than MAMP or XAMP alone. Use instead of XAMP or MAMP.

http://serverpress.com/products/desktopserver/ 

SlightlyModded

http://aquagraphite.com/2011/09/slightly-modded-options-framework/ 

Slighty Modded Options Framework or SMOF is an Options Framework for WordPress theme developers. It was heavily built on helgatheviking’s KIA Options Framework, which was forked from the original Options Framework by Devin Price. Some of the ideas and aesthetics improvements were borrowed from the Options Tree.

The main objective of the SMOF is to offer modern-looking, features rich Options Framework for theme developers.

To activate the theme options, open your functions.php file and copy/paste the code from the slightly-modded website. Once you paste this is and same, you’ll see a new “Theme Options” page show up under Appearance.

Could be useful for creating custom theme elements that are easily updated by a client (favicon, logo, phone number, etc.).

Gregg has used this to replace the default theme options used in some themes, particularly when they don’t follow the standard WordPress admin look-and-feel.

Brandon Dove noted that there are security considerations. If a client with admin access pastes in some bad javascript or other code into these fields, it can wreak havoc on the site.

Javascript in WordPress

Jeffrey Zinn

The Process

  1. Use wp_enqueue_scripts action to load your selected javascripts
  2. State a script by calling the wp_register_script function
  3. Load the script from #2 using wp_enqueue_script function

<?php

/** JavaScripts **/

add_action( ‘wp_enqueue_scripts’, ‘custom_enqueue_scripts’ );

function custom_enqueue_scripts() {

$src = get_stylesheet_directory_uri() . ‘/js/justom.js’;

wp_register_script( ‘custom-script,’ $src, array(‘jquery’), ‘1’, TRUE );

wp_enqueue_script( ‘custom-script’ );

}

?>

<?php

/** JavaScripts **/

add_action( ‘wp_enqueue_scripts’, ‘custom_enqueue_scripts’ );

function custom_enqueue_scripts() {

wp_deregister_script (‘swfupload’);

$src = ‘http://ajax.googleapis.com...etc’;

wp_register_script( ‘jquery’, $src, array(), ‘1.7.1’);

wp_enqueue_script(‘jquery’);

}

?>

Photocrati Theme 

Anton Vasilescu

http://www.photocrati.com/ 

Themes for Photographers