SlideShare a Scribd company logo
WordPress Meetup #12
            July 22, 2012


       WordPress Nepal
           wpnepal.org
facebook.com/groups/wordpressnepal
WordPress 3.4
Theme Customizer
    Chandra Maharzan
        nhuja.com
     tweet @maharzan
Daryl Koopersmith
  WordPress Core Developer
Why use it?

• Live Preview - no rush
Quick Demo
First things first
•   add_theme_support( 'custom-header' );
•   add_theme_support( 'custom-background' );

•   register_nav_menus ( );
Theme Options
• Theme Mod
 •   set_theme_mod / get_theme_mod

• Individual Settings
• Serialized Settings
 •   set_option / get_option
Structure
            WP_Customize_Section

            WP_Customize_Control

            WP_Customize_Setting
Extensions

•   WP_Customize_Upload_Control

•   WP_Customize_Image_Control

•   WP_Customize_Header_Image_Control
So, How do we do it?

•   add_action( 'customize_register', 'my_function' );

•   function my_function ( $wp_customize ) {

•   $wp_customize->add_section( );

•   $wp_customize->add_setting( );

•   $wp_customize->add_control( );
The LIVE FUN!
• 'transport' => 'postMessage'
•   $wp_customize->add_setting( 'cleanr_options[color]', array(
           'default'    => '',
           'type'      => 'option',
           'capability' => 'edit_theme_options',
           'transport' => 'postMessage'
    ) );
•   if ( $wp_customize->is_preview() && !
    is_admin() )
    add_action( 'wp_footer', 'my_custom_preview',
    21);
•   <?php function my_custom_preview() { ?>
       <script type="text/javascript">
      ( function( $ ){
      wp.customize( 'setting_name', function( value ) {
         value.bind( function( to ) {
            $( '.posttitle' ).css( 'color', to ? '#' + to : '' );
         });
      });
      } )( jQuery );
    </script>
    <?php } ?>
Lets see some code!
Improvements
 • Textarea Type
  • CSS Plugin by Daryl Koop
 • Clear Color HEX
 • Refresh Time
References

 • http://ottopress.com
 • http://codex.wordpress.org
 • http://graphpaperpress.com
Thank you
  Questions?

More Related Content

PDF
What we can learn from WordPress as a developer
PDF
Image manipulation in WordPress 3.5
PDF
Make your own wp cli command in 10min
PDF
WordCamp Bristol 2019 - WordPress custom theme building
DOC
20110820 header new style
PDF
Writing Secure Plugins — WordCamp New York 2009
TXT
Index
What we can learn from WordPress as a developer
Image manipulation in WordPress 3.5
Make your own wp cli command in 10min
WordCamp Bristol 2019 - WordPress custom theme building
20110820 header new style
Writing Secure Plugins — WordCamp New York 2009
Index

What's hot (20)

PPTX
Using shortcode in plugin development
PDF
Wynn Netherland: Accelerating Titanium Development with CoffeeScript, Compass...
PDF
jQuery in 15 minutes
PDF
HTML5 and CSS3 Refresher
PPTX
JS.Chi CSS Animations
PDF
Андрей Юртаев - Improve theming with (Twitter) Bootstrap
PPTX
Drupal 7 — Circle theme
KEY
Efficient theming in Drupal
PDF
WordPress Cuztom Helper
PPTX
CSS: A Slippery Slope to the Backend
PDF
Variations on a Theme
PPTX
18. images in symfony 4
ODP
Mojolicious on Steroids
PDF
Accelerated Native Mobile Development with the Ti gem
PPT
LESS(CSS preprocessor)
PPSX
WordPress Theme Design and Development Workshop - Day 3
PDF
Mojolicious
PDF
i18n for Plugin and Theme Developers, WordCamp Milano 2016
PDF
Mojolicious, real-time web framework
PPT
How to learn j query
Using shortcode in plugin development
Wynn Netherland: Accelerating Titanium Development with CoffeeScript, Compass...
jQuery in 15 minutes
HTML5 and CSS3 Refresher
JS.Chi CSS Animations
Андрей Юртаев - Improve theming with (Twitter) Bootstrap
Drupal 7 — Circle theme
Efficient theming in Drupal
WordPress Cuztom Helper
CSS: A Slippery Slope to the Backend
Variations on a Theme
18. images in symfony 4
Mojolicious on Steroids
Accelerated Native Mobile Development with the Ti gem
LESS(CSS preprocessor)
WordPress Theme Design and Development Workshop - Day 3
Mojolicious
i18n for Plugin and Theme Developers, WordCamp Milano 2016
Mojolicious, real-time web framework
How to learn j query
Ad

Viewers also liked (7)

PPTX
Be HTML5-ready today
PPS
Maxxconnect Presentation
PPTX
Thucydides - /by Igor Rozdobudko
KEY
Interesting Theme Shop Stats
PDF
Chandra Maharzan: The Future of Web Design Experience
PPTX
WordPress Security Implementation Guideline - Presentation for OWASP Romania ...
PDF
Chandra Maharzan: Making a successful career out of WordPress
Be HTML5-ready today
Maxxconnect Presentation
Thucydides - /by Igor Rozdobudko
Interesting Theme Shop Stats
Chandra Maharzan: The Future of Web Design Experience
WordPress Security Implementation Guideline - Presentation for OWASP Romania ...
Chandra Maharzan: Making a successful career out of WordPress
Ad

Similar to WordPress 3.4 Theme Customizer (20)

PDF
WordCamp Praga 2015
PPT
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
PDF
You're Doing it Wrong - WordCamp Atlanta
PPTX
Building Potent WordPress Websites
PDF
Becoming a better WordPress Developer
PPTX
PSD to WordPress
PDF
WordPress Café: Using WordPress as a Framework
PDF
Supercharging WordPress Development - Wordcamp Brighton 2019
PPT
Custom Post Types and Meta Fields
PDF
How to make a WordPress theme
PDF
[WLDN] Supercharging word press development in 2018
PDF
Seven deadly theming sins
KEY
Writing extensible Word press-plugins
PPTX
WordPress customizer for themes and more
PDF
Gail villanueva add muscle to your wordpress site
KEY
WordPress Developers Israel Meetup #1
KEY
Word Camp Fukuoka2010
PDF
[Bristol WordPress] Supercharging WordPress Development
PPTX
Getting Started With WordPress Development
PPTX
WordPress for developers - phpday 2011
WordCamp Praga 2015
Hardcore URL Routing for WordPress - WordCamp Atlanta 2014 (PPT)
You're Doing it Wrong - WordCamp Atlanta
Building Potent WordPress Websites
Becoming a better WordPress Developer
PSD to WordPress
WordPress Café: Using WordPress as a Framework
Supercharging WordPress Development - Wordcamp Brighton 2019
Custom Post Types and Meta Fields
How to make a WordPress theme
[WLDN] Supercharging word press development in 2018
Seven deadly theming sins
Writing extensible Word press-plugins
WordPress customizer for themes and more
Gail villanueva add muscle to your wordpress site
WordPress Developers Israel Meetup #1
Word Camp Fukuoka2010
[Bristol WordPress] Supercharging WordPress Development
Getting Started With WordPress Development
WordPress for developers - phpday 2011

Recently uploaded (20)

PPTX
master seminar digital applications in india
PPTX
Pharma ospi slides which help in ospi learning
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Computing-Curriculum for Schools in Ghana
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Pre independence Education in Inndia.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Institutional Correction lecture only . . .
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Sports Quiz easy sports quiz sports quiz
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Basic Mud Logging Guide for educational purpose
PDF
RMMM.pdf make it easy to upload and study
master seminar digital applications in india
Pharma ospi slides which help in ospi learning
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Computing-Curriculum for Schools in Ghana
Module 4: Burden of Disease Tutorial Slides S2 2025
Pre independence Education in Inndia.pdf
Anesthesia in Laparoscopic Surgery in India
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
TR - Agricultural Crops Production NC III.pdf
Insiders guide to clinical Medicine.pdf
Institutional Correction lecture only . . .
Final Presentation General Medicine 03-08-2024.pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Sports Quiz easy sports quiz sports quiz
O7-L3 Supply Chain Operations - ICLT Program
Basic Mud Logging Guide for educational purpose
RMMM.pdf make it easy to upload and study

WordPress 3.4 Theme Customizer

  • 1. WordPress Meetup #12 July 22, 2012 WordPress Nepal wpnepal.org facebook.com/groups/wordpressnepal
  • 2. WordPress 3.4 Theme Customizer Chandra Maharzan nhuja.com tweet @maharzan
  • 3. Daryl Koopersmith WordPress Core Developer
  • 4. Why use it? • Live Preview - no rush
  • 6. First things first • add_theme_support( 'custom-header' ); • add_theme_support( 'custom-background' ); • register_nav_menus ( );
  • 7. Theme Options • Theme Mod • set_theme_mod / get_theme_mod • Individual Settings • Serialized Settings • set_option / get_option
  • 8. Structure WP_Customize_Section WP_Customize_Control WP_Customize_Setting
  • 9. Extensions • WP_Customize_Upload_Control • WP_Customize_Image_Control • WP_Customize_Header_Image_Control
  • 10. So, How do we do it? • add_action( 'customize_register', 'my_function' ); • function my_function ( $wp_customize ) { • $wp_customize->add_section( ); • $wp_customize->add_setting( ); • $wp_customize->add_control( );
  • 11. The LIVE FUN! • 'transport' => 'postMessage' • $wp_customize->add_setting( 'cleanr_options[color]', array( 'default' => '', 'type' => 'option', 'capability' => 'edit_theme_options', 'transport' => 'postMessage' ) );
  • 12. if ( $wp_customize->is_preview() && ! is_admin() ) add_action( 'wp_footer', 'my_custom_preview', 21); • <?php function my_custom_preview() { ?> <script type="text/javascript"> ( function( $ ){ wp.customize( 'setting_name', function( value ) { value.bind( function( to ) { $( '.posttitle' ).css( 'color', to ? '#' + to : '' ); }); }); } )( jQuery ); </script> <?php } ?>
  • 13. Lets see some code!
  • 14. Improvements • Textarea Type • CSS Plugin by Daryl Koop • Clear Color HEX • Refresh Time
  • 15. References • http://ottopress.com • http://codex.wordpress.org • http://graphpaperpress.com
  • 16. Thank you Questions?

Editor's Notes