SlideShare a Scribd company logo
WordCamp Albuquerque 2013 | Ray Gulick, Evo
Making the leap
from Designer
to Designer/Developer
WordCamp Albuquerque 2013 | Ray Gulick, Evo 2
Ray Gulick
principal/creative director/designer/developer/trash emptier
Evolution Web Development
Santa Fe, New Mexico
www.evowebdev.com
www.raygulick.com
@evoweb #wcabq
WordCamp Albuquerque 2013 | Ray Gulick, Evo 3
Quote* from famous dead guy
Design is not just
how it looks.
Design is how it works.
Steve Jobs
*Shortened and improved, because that's what designers do.
WordCamp Albuquerque 2013 | Ray Gulick, Evo 4
DESIGN
Visual
Design Coding
Coding is part of
design.
Just like visual design.
WordCamp Albuquerque 2013 | Ray Gulick, Evo 5
Dammit, Jim!
I’m a designer!
Coding skills and knowledge you
probably already have:
1. HTML
2. CSS
3. Basic first aid
WordCamp Albuquerque 2013 | Ray Gulick, Evo 6
Some fundamental WordPress
developer code knowledge*
1. PHP and WordPress Tags
2. Custom Fields and putting them
on templates
3. Custom Post Types
4. WP_Query to manage listings
*Becoming a designer/developer is a process; learn by doing.
These will get you started. And probably ruin your life. Or at
least an occasional weekend.
WordCamp Albuquerque 2013 | Ray Gulick, Evo 7
PHP is not as painful as it looks.
Server side		 code gets processed on server
<?php ?> 		 opening and closing tags
<?php
	 $note = get_post_meta($post_id, 'note_text', true);
	 if ($note) {
		echo '<div class="sidebarnote">';
		echo '<p>'.$note.'</p>';
		echo '</div>';
	}
?>
function cf key
single
value?
meta value
post ID
Syntax
Rules of
language
usage
WordCamp Albuquerque 2013 | Ray Gulick, Evo 8
WordPress Tags
PHP, but simpler, sort of; using functions
that are part of core, saving a lot of
coding for WP designer/developers.
<?php if (have_posts()) : ?>
	<?php while (have_posts()) : the_post(); ?>
		<h1><?php the_title(); ?></h1>
		<?php the_content('Read more'); ?>
	<?php endwhile; ?>
<?php endif; ?>
WordCamp Albuquerque 2013 | Ray Gulick, Evo 9
What are Custom Fields?
WordPress has standard fields, such as:
the_title
the_content
Templates display the values of the
fields using the following tags:
<?php the_title(); ?>
<?php the_content(); ?>
WordCamp Albuquerque 2013 | Ray Gulick, Evo 10
Custom fields are fields you define
and display on templates using
your own tags.
You might create some custom fields
with these custom field keys:
pagepix
pagepix_alt
pagepix_caption
Note: example code which follows assumes use of Advanced
Custom Fields plugin to create/organize custom fields.
WordCamp Albuquerque 2013 | Ray Gulick, Evo 11
Custom fields displayed on template
with conditional code:
<?php
	 $pix = get_field('pagepix');
	 $alt = get_field('pagepix_alt');
	 $caption = get_field('pagepix_caption');
	 if (($pix) && ($alt)) {
		echo '<div class="pagepix">';
		echo '<img src="'.$pix.'" alt="'.$alt.'" />';
			if ($caption) {
				echo '<p>'.$caption.'</p>';
			}
		echo '</div>';
	}
?>
Method
used by
ACF plugin
WordCamp Albuquerque 2013 | Ray Gulick, Evo 12
If there is a value for each of the custom
fields, this HTML is rendered:
<div class="pagepix">
	 <img src="http://www.domain.com/wp-content/uploads/
imagename.jpg" alt="image description" />
	<p>This is the caption for this image.</p>
</div>
It might be styled with this CSS:
.pagepix {width:338px; float:right; margin:.5em 0 .2em 18px;}
.pagepix img {width:338px !important;}
.pagepix p {font-size:12px; color:#666; margin:3px 0;}
which leads us to:
WordCamp Albuquerque 2013 | Ray Gulick, Evo 13
The most important* thing about
custom fields:
Custom fields can add content
into pre-formatted areas.
Means there is no need for the CMS user to be
concerned with style, or for the web designer to
be concerned about how the website will look
two weeks after launch.
*somewhat biased opinion
WordCamp Albuquerque 2013 | Ray Gulick, Evo 14
Custom fields are great!
1. Allow faster, simpler website updates
for CMS users
2. Allow designer more control of look
and feel and more consistency in
presentation
3. But...
WordCamp Albuquerque 2013 | Ray Gulick, Evo 15
The problem with custom fields is
the WordPress user interface.
1. Field keys listed
alphabetically;
difficult to group
related fields
2. No clues about
what kind of info
we want for the
value
WordCamp Albuquerque 2013 | Ray Gulick, Evo 16
Advanced Custom Fields plugin
1. User-friendly
metabox title
2. User-friendly
field label
(no field key)
3. Hints above
entry field
WordCamp Albuquerque 2013 | Ray Gulick, Evo 17
Control where ACF metaboxes
appear, and to whom they appear.
Place metaboxes on edit screens based on
Post Type (incl. Custom Post Types), Page
Template, Page Parent, Taxonomies, User
Role, and other criteria.
WordCamp Albuquerque 2013 | Ray Gulick, Evo 18
Lots of options for
field type, then
further customization
of selected field type.
ACF Field Type Options!!!
WordCamp Albuquerque 2013 | Ray Gulick, Evo 19
Why Custom Post Types?
With a custom post type, you can:
1. Specify which standard metaboxes appear on
the post type create/edit screens (title, editor,
excerpt)
2. Create custom fields specifically for the post
type, grouped in metaboxes that only appear
on the post type add/edit screen (ACF)
3. Create templates specifically needed for
custom post type content
WordCamp Albuquerque 2013 | Ray Gulick, Evo 20
Register CPT in theme’s functions.php file:
add_action('init', 'create_custom_post_types');
function create_custom_post_types() {
register_post_type('news',
	 array('labels' => array(
			'name' => __('News Items'),
			'singular_name' => __('News Item'),
			'add_new' => __('Add New'),
			'add_new_item' => __('Add News Item'),
			'edit' => __('Edit'),
			'edit_item' => __('Edit News Item'),
			'new_item' => __('New News Item'),
			'view' => __('View News Items'),
			'view_item' => __('View News Item'),
			'search_items' => __('Search News Items'),
			'not_found' => __('No News Items found'),
			'not_found_in_trash' => __('No News Items found in
			Trash'),
			),
CPT name
WordCamp Albuquerque 2013 | Ray Gulick, Evo 21
		'menu_icon' => get_stylesheet_directory_uri().
				'/images/newspaper.png',
		'public' => true,
		'show_ui' => true,
		'publicly_queryable' => true,
		'exclude_from_search' => false,
		'capability_type' => 'post',
		'hierarchical' => false,
		'rewrite' => array('slug' => 'news-item',
		'with_front' => false),
		'query_var' => true,
		'supports' => array('title', 'editor', 'excerpt')
		)
	);
	 flush_rewrite_rules();
}
SLUG
WordCamp Albuquerque 2013 | Ray Gulick, Evo 22
Important stuff about CPTs
1. The “slug” cannot be the same as the CPT
name.
2. CPTs display on a template named
single-cptname.php (i.e., single-news.php)
3. Single template must contain appropriate
code to display the custom fields you want to
display in the CPT.
4. CPT listings are created with post type queries
placed on a “listings” page template.
WordCamp Albuquerque 2013 | Ray Gulick, Evo 23
page_newslist.php (page template)
WordCamp Albuquerque 2013 | Ray Gulick, Evo 24
WP_Query for ‘news’ CPT Listing
	 <?php
		$paged = ( get_query_var('paged')) ? get_query_var('paged') : 1;
		 $newslist = new WP_Query ( array(
				'post_type' => 'news',
				'posts_per_page' => 5,
				'paged' => $paged ));
		 if ($newslist->have_posts()) : while ($newslist->have_posts()) :
		$newslist->the_post();
	 ?>
		<div class="excerpt">
			 <?php the_title( '<h2><a href="'.get_permalink().'">',
			'</a>&raquo;</h2>' ); ?>
			 <p class="newsdate"><?php the_time('n/j/y'); ?> &ndash;</p>
			<?php the_excerpt(); ?>
		</div>
	 <?php endwhile; endif;	
		if(function_exists('wp_pagenavi'))
		wp_pagenavi( array( 'query' => $newslist ) );
	 ?>
WordCamp Albuquerque 2013 | Ray Gulick, Evo 25
single-news.php
WordCamp Albuquerque 2013 | Ray Gulick, Evo 26
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?> 			
	 <article class="pagecontent">
		<h1><?php the_title(); ?></h1>
		<?php get_template_part('pix');?>
		<p class="newsdate"><?php the_time('n/j/y');
?> &ndash;</p>
		<?php the_content('Read more'); ?>
	</article>
<?php endwhile; ?>
<?php endif; ?>
Display CPT content on News
single template (single-news.php)
WordCamp Albuquerque 2013 | Ray Gulick, Evo 27
Learn more
http://www.php.net/manual/en/index.php
http://codex.wordpress.org/Custom_Fields
http://wordpress.org/extend/plugins/advanced-custom-fields/
http://codex.wordpress.org/Function_Reference/register_post_type
http://justintadlock.com/archives/2010/04/29/custom-post-types-in-
wordpress
http://codex.wordpress.org/Class_Reference/WP_Query
http://wordpress.stackexchange.com
http://generatewp.com/
WordCamp Albuquerque 2013 | Ray Gulick, Evo 28
Questions?
?? ??? ?

More Related Content

What's hot

Architecture | Busy Java Developers Guide to NoSQL | Ted Neward
Architecture | Busy Java Developers Guide to NoSQL | Ted NewardArchitecture | Busy Java Developers Guide to NoSQL | Ted Neward
Architecture | Busy Java Developers Guide to NoSQL | Ted Neward
JAX London
 
Css, xhtml, javascript
Css, xhtml, javascriptCss, xhtml, javascript
Css, xhtml, javascript
Trần Khải Hoàng
 
Jumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin ProgrammingJumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin Programming
Dougal Campbell
 
WordPress and Ajax
WordPress and AjaxWordPress and Ajax
WordPress and Ajax
Ronald Huereca
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPress
Nile Flores
 
JD17NL Joomla! Overrides and alternate layouts
JD17NL Joomla! Overrides and alternate layoutsJD17NL Joomla! Overrides and alternate layouts
JD17NL Joomla! Overrides and alternate layouts
Hans Kuijpers
 
Android | Busy Java Developers Guide to Android: UI | Ted Neward
Android | Busy Java Developers Guide to Android: UI | Ted NewardAndroid | Busy Java Developers Guide to Android: UI | Ted Neward
Android | Busy Java Developers Guide to Android: UI | Ted Neward
JAX London
 
Various Ways of Using WordPress
Various Ways of Using WordPressVarious Ways of Using WordPress
Various Ways of Using WordPress
Nick La
 
JavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your codeJavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your code
Laurence Svekis ✔
 
Ant - Another Neat Tool
Ant - Another Neat ToolAnt - Another Neat Tool
Ant - Another Neat Tool
Kanika2885
 
Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1
フ乇丂ひ丂
 
SharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuerySharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuery
Mark Rackley
 
Cartegraph Live HTML, CSS, JavaScript and jQuery Training
Cartegraph Live HTML, CSS, JavaScript and jQuery TrainingCartegraph Live HTML, CSS, JavaScript and jQuery Training
Cartegraph Live HTML, CSS, JavaScript and jQuery Training
Shane Church
 
HTML5 & Friends
HTML5 & FriendsHTML5 & Friends
HTML5 & Friends
Remy Sharp
 
Writing your Third Plugin
Writing your Third PluginWriting your Third Plugin
Writing your Third Plugin
Justin Ryan
 
Fewd week4 slides
Fewd week4 slidesFewd week4 slides
Fewd week4 slides
William Myers
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To Practice
Sergey Bolshchikov
 
Whidbey old
Whidbey old Whidbey old
Whidbey old
grenaud
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
zonathen
 

What's hot (19)

Architecture | Busy Java Developers Guide to NoSQL | Ted Neward
Architecture | Busy Java Developers Guide to NoSQL | Ted NewardArchitecture | Busy Java Developers Guide to NoSQL | Ted Neward
Architecture | Busy Java Developers Guide to NoSQL | Ted Neward
 
Css, xhtml, javascript
Css, xhtml, javascriptCss, xhtml, javascript
Css, xhtml, javascript
 
Jumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin ProgrammingJumping Into WordPress Plugin Programming
Jumping Into WordPress Plugin Programming
 
WordPress and Ajax
WordPress and AjaxWordPress and Ajax
WordPress and Ajax
 
PSD to WordPress
PSD to WordPressPSD to WordPress
PSD to WordPress
 
JD17NL Joomla! Overrides and alternate layouts
JD17NL Joomla! Overrides and alternate layoutsJD17NL Joomla! Overrides and alternate layouts
JD17NL Joomla! Overrides and alternate layouts
 
Android | Busy Java Developers Guide to Android: UI | Ted Neward
Android | Busy Java Developers Guide to Android: UI | Ted NewardAndroid | Busy Java Developers Guide to Android: UI | Ted Neward
Android | Busy Java Developers Guide to Android: UI | Ted Neward
 
Various Ways of Using WordPress
Various Ways of Using WordPressVarious Ways of Using WordPress
Various Ways of Using WordPress
 
JavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your codeJavaScript Advanced - Useful methods to power up your code
JavaScript Advanced - Useful methods to power up your code
 
Ant - Another Neat Tool
Ant - Another Neat ToolAnt - Another Neat Tool
Ant - Another Neat Tool
 
Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1Appcelerator Titanium Kinetic practices part 1
Appcelerator Titanium Kinetic practices part 1
 
SharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuerySharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuery
 
Cartegraph Live HTML, CSS, JavaScript and jQuery Training
Cartegraph Live HTML, CSS, JavaScript and jQuery TrainingCartegraph Live HTML, CSS, JavaScript and jQuery Training
Cartegraph Live HTML, CSS, JavaScript and jQuery Training
 
HTML5 & Friends
HTML5 & FriendsHTML5 & Friends
HTML5 & Friends
 
Writing your Third Plugin
Writing your Third PluginWriting your Third Plugin
Writing your Third Plugin
 
Fewd week4 slides
Fewd week4 slidesFewd week4 slides
Fewd week4 slides
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To Practice
 
Whidbey old
Whidbey old Whidbey old
Whidbey old
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 

Similar to WordCamp ABQ 2013: Making the leap from Designer to Designer/Developer

Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to Swagger
Knoldus Inc.
 
Google Apps Script for Beginners- Amazing Things with Code
Google Apps Script for Beginners- Amazing Things with CodeGoogle Apps Script for Beginners- Amazing Things with Code
Google Apps Script for Beginners- Amazing Things with Code
Laurence Svekis ✔
 
Brand Your Community Using Less and Gulp
Brand Your Community Using Less and GulpBrand Your Community Using Less and Gulp
Brand Your Community Using Less and Gulp
shujiui
 
WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...
Denise Williams
 
IT230-Assignment 1 Solved.pdf
IT230-Assignment 1 Solved.pdfIT230-Assignment 1 Solved.pdf
IT230-Assignment 1 Solved.pdf
Dark179280
 
Acquia Drupal Certification
Acquia Drupal CertificationAcquia Drupal Certification
Acquia Drupal Certification
Philip Norton
 
Engage - Expanding XPages with Bootstrap Plugins for ultimate usability
Engage - Expanding XPages with Bootstrap Plugins for ultimate usabilityEngage - Expanding XPages with Bootstrap Plugins for ultimate usability
Engage - Expanding XPages with Bootstrap Plugins for ultimate usability
Johnny Oldenburger
 
Extending MadCap Flare HTML5 Targets with jQuery - MadWorld 2016, Scott DeLoa...
Extending MadCap Flare HTML5 Targets with jQuery - MadWorld 2016, Scott DeLoa...Extending MadCap Flare HTML5 Targets with jQuery - MadWorld 2016, Scott DeLoa...
Extending MadCap Flare HTML5 Targets with jQuery - MadWorld 2016, Scott DeLoa...
Scott DeLoach
 
A new look for e4
A new look for e4A new look for e4
A new look for e4
susanfmccourt
 
Advanced Custom Fields: Amazing Possibilities and Irritating Limitations
Advanced Custom Fields: Amazing Possibilities and Irritating LimitationsAdvanced Custom Fields: Amazing Possibilities and Irritating Limitations
Advanced Custom Fields: Amazing Possibilities and Irritating Limitations
East Bay WordPress Meetup
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
Iván Fernández Perea
 
Managing and evolving JavaScript Code
Managing and evolving JavaScript CodeManaging and evolving JavaScript Code
Managing and evolving JavaScript Code
Jean Carlo Emer
 
From Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) AgainFrom Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) Again
jonknapp
 
Advanced Custom Fields - Flexible Content
Advanced Custom Fields - Flexible ContentAdvanced Custom Fields - Flexible Content
Advanced Custom Fields - Flexible Content
Norm Euker
 
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Damien Carbery
 
Brand Your Community Using Less and Gulp
Brand Your Community Using Less and GulpBrand Your Community Using Less and Gulp
Brand Your Community Using Less and Gulp
Salesforce Developers
 
How I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptHow I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScript
Kevin Read
 
Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8
Kevin Read
 
Getting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with ThymeleafGetting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with Thymeleaf
Masatoshi Tada
 
Developing Custom WordPress Themes for Clients
Developing Custom WordPress Themes for ClientsDeveloping Custom WordPress Themes for Clients
Developing Custom WordPress Themes for Clients
Steven Slack
 

Similar to WordCamp ABQ 2013: Making the leap from Designer to Designer/Developer (20)

Introduction to Swagger
Introduction to SwaggerIntroduction to Swagger
Introduction to Swagger
 
Google Apps Script for Beginners- Amazing Things with Code
Google Apps Script for Beginners- Amazing Things with CodeGoogle Apps Script for Beginners- Amazing Things with Code
Google Apps Script for Beginners- Amazing Things with Code
 
Brand Your Community Using Less and Gulp
Brand Your Community Using Less and GulpBrand Your Community Using Less and Gulp
Brand Your Community Using Less and Gulp
 
WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...
 
IT230-Assignment 1 Solved.pdf
IT230-Assignment 1 Solved.pdfIT230-Assignment 1 Solved.pdf
IT230-Assignment 1 Solved.pdf
 
Acquia Drupal Certification
Acquia Drupal CertificationAcquia Drupal Certification
Acquia Drupal Certification
 
Engage - Expanding XPages with Bootstrap Plugins for ultimate usability
Engage - Expanding XPages with Bootstrap Plugins for ultimate usabilityEngage - Expanding XPages with Bootstrap Plugins for ultimate usability
Engage - Expanding XPages with Bootstrap Plugins for ultimate usability
 
Extending MadCap Flare HTML5 Targets with jQuery - MadWorld 2016, Scott DeLoa...
Extending MadCap Flare HTML5 Targets with jQuery - MadWorld 2016, Scott DeLoa...Extending MadCap Flare HTML5 Targets with jQuery - MadWorld 2016, Scott DeLoa...
Extending MadCap Flare HTML5 Targets with jQuery - MadWorld 2016, Scott DeLoa...
 
A new look for e4
A new look for e4A new look for e4
A new look for e4
 
Advanced Custom Fields: Amazing Possibilities and Irritating Limitations
Advanced Custom Fields: Amazing Possibilities and Irritating LimitationsAdvanced Custom Fields: Amazing Possibilities and Irritating Limitations
Advanced Custom Fields: Amazing Possibilities and Irritating Limitations
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
Managing and evolving JavaScript Code
Managing and evolving JavaScript CodeManaging and evolving JavaScript Code
Managing and evolving JavaScript Code
 
From Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) AgainFrom Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) Again
 
Advanced Custom Fields - Flexible Content
Advanced Custom Fields - Flexible ContentAdvanced Custom Fields - Flexible Content
Advanced Custom Fields - Flexible Content
 
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)Debugging - Figuring it out yourself (WordCamp Dublin 2019)
Debugging - Figuring it out yourself (WordCamp Dublin 2019)
 
Brand Your Community Using Less and Gulp
Brand Your Community Using Less and GulpBrand Your Community Using Less and Gulp
Brand Your Community Using Less and Gulp
 
How I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScriptHow I learned to stop worrying and love embedding JavaScript
How I learned to stop worrying and love embedding JavaScript
 
Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8Embedding V8 in Android apps with Ejecta-V8
Embedding V8 in Android apps with Ejecta-V8
 
Getting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with ThymeleafGetting start Java EE Action-Based MVC with Thymeleaf
Getting start Java EE Action-Based MVC with Thymeleaf
 
Developing Custom WordPress Themes for Clients
Developing Custom WordPress Themes for ClientsDeveloping Custom WordPress Themes for Clients
Developing Custom WordPress Themes for Clients
 

Recently uploaded

Heuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdfHeuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdf
Jaime Brown
 
一比一原版马来西亚世纪大学毕业证成绩单一模一样
一比一原版马来西亚世纪大学毕业证成绩单一模一样一比一原版马来西亚世纪大学毕业证成绩单一模一样
一比一原版马来西亚世纪大学毕业证成绩单一模一样
k4krdgxx
 
ARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdfARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdf
Knight Moves
 
Manual ISH (International Society of Hypertension)
Manual ISH (International Society of Hypertension)Manual ISH (International Society of Hypertension)
Manual ISH (International Society of Hypertension)
bagmai
 
Practical eLearning Makeovers for Everyone
Practical eLearning Makeovers for EveryonePractical eLearning Makeovers for Everyone
Practical eLearning Makeovers for Everyone
Bianca Woods
 
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
k7nm6tk
 
Getting Data Ready for Culture Hack by Neontribe
Getting Data Ready for Culture Hack by NeontribeGetting Data Ready for Culture Hack by Neontribe
Getting Data Ready for Culture Hack by Neontribe
Harry Harrold
 
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
881evgn0
 
Graphic Design Tools and Software .pptx
Graphic Design Tools and Software   .pptxGraphic Design Tools and Software   .pptx
Graphic Design Tools and Software .pptx
Virtual Real Design
 
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
qo1as76n
 
UXpert_Report (UALR Mapping Renewal 2022).pdf
UXpert_Report (UALR Mapping Renewal 2022).pdfUXpert_Report (UALR Mapping Renewal 2022).pdf
UXpert_Report (UALR Mapping Renewal 2022).pdf
anthonylin333
 
International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4
Kyungeun Sung
 
CocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdfCocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdf
PabloMartelLpez
 
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
9lq7ultg
 
一比一原版肯特大学毕业证UKC成绩单一模一样
一比一原版肯特大学毕业证UKC成绩单一模一样一比一原版肯特大学毕业证UKC成绩单一模一样
一比一原版肯特大学毕业证UKC成绩单一模一样
tobbk6s8
 
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
ijk38lw
 
Divertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8djDivertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8dj
lunaemel03
 
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
bo44ban1
 
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
kuapy
 
NHR Engineers Portfolio 2023 2024 NISHANT RATHI
NHR Engineers Portfolio 2023 2024 NISHANT RATHINHR Engineers Portfolio 2023 2024 NISHANT RATHI
NHR Engineers Portfolio 2023 2024 NISHANT RATHI
NishantRathi18
 

Recently uploaded (20)

Heuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdfHeuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdf
 
一比一原版马来西亚世纪大学毕业证成绩单一模一样
一比一原版马来西亚世纪大学毕业证成绩单一模一样一比一原版马来西亚世纪大学毕业证成绩单一模一样
一比一原版马来西亚世纪大学毕业证成绩单一模一样
 
ARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdfARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdf
 
Manual ISH (International Society of Hypertension)
Manual ISH (International Society of Hypertension)Manual ISH (International Society of Hypertension)
Manual ISH (International Society of Hypertension)
 
Practical eLearning Makeovers for Everyone
Practical eLearning Makeovers for EveryonePractical eLearning Makeovers for Everyone
Practical eLearning Makeovers for Everyone
 
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
 
Getting Data Ready for Culture Hack by Neontribe
Getting Data Ready for Culture Hack by NeontribeGetting Data Ready for Culture Hack by Neontribe
Getting Data Ready for Culture Hack by Neontribe
 
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
一比一原版美国哥伦比亚大学毕业证Columbia成绩单一模一样
 
Graphic Design Tools and Software .pptx
Graphic Design Tools and Software   .pptxGraphic Design Tools and Software   .pptx
Graphic Design Tools and Software .pptx
 
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
 
UXpert_Report (UALR Mapping Renewal 2022).pdf
UXpert_Report (UALR Mapping Renewal 2022).pdfUXpert_Report (UALR Mapping Renewal 2022).pdf
UXpert_Report (UALR Mapping Renewal 2022).pdf
 
International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4
 
CocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdfCocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdf
 
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
一比一原版马里兰大学毕业证(UMD毕业证书)如何办理
 
一比一原版肯特大学毕业证UKC成绩单一模一样
一比一原版肯特大学毕业证UKC成绩单一模一样一比一原版肯特大学毕业证UKC成绩单一模一样
一比一原版肯特大学毕业证UKC成绩单一模一样
 
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
 
Divertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8djDivertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8dj
 
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
 
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
按照学校原版(UIUC文凭证书)伊利诺伊大学|厄巴纳-香槟分校毕业证快速办理
 
NHR Engineers Portfolio 2023 2024 NISHANT RATHI
NHR Engineers Portfolio 2023 2024 NISHANT RATHINHR Engineers Portfolio 2023 2024 NISHANT RATHI
NHR Engineers Portfolio 2023 2024 NISHANT RATHI
 

WordCamp ABQ 2013: Making the leap from Designer to Designer/Developer

  • 1. WordCamp Albuquerque 2013 | Ray Gulick, Evo Making the leap from Designer to Designer/Developer
  • 2. WordCamp Albuquerque 2013 | Ray Gulick, Evo 2 Ray Gulick principal/creative director/designer/developer/trash emptier Evolution Web Development Santa Fe, New Mexico www.evowebdev.com www.raygulick.com @evoweb #wcabq
  • 3. WordCamp Albuquerque 2013 | Ray Gulick, Evo 3 Quote* from famous dead guy Design is not just how it looks. Design is how it works. Steve Jobs *Shortened and improved, because that's what designers do.
  • 4. WordCamp Albuquerque 2013 | Ray Gulick, Evo 4 DESIGN Visual Design Coding Coding is part of design. Just like visual design.
  • 5. WordCamp Albuquerque 2013 | Ray Gulick, Evo 5 Dammit, Jim! I’m a designer! Coding skills and knowledge you probably already have: 1. HTML 2. CSS 3. Basic first aid
  • 6. WordCamp Albuquerque 2013 | Ray Gulick, Evo 6 Some fundamental WordPress developer code knowledge* 1. PHP and WordPress Tags 2. Custom Fields and putting them on templates 3. Custom Post Types 4. WP_Query to manage listings *Becoming a designer/developer is a process; learn by doing. These will get you started. And probably ruin your life. Or at least an occasional weekend.
  • 7. WordCamp Albuquerque 2013 | Ray Gulick, Evo 7 PHP is not as painful as it looks. Server side code gets processed on server <?php ?> opening and closing tags <?php $note = get_post_meta($post_id, 'note_text', true); if ($note) { echo '<div class="sidebarnote">'; echo '<p>'.$note.'</p>'; echo '</div>'; } ?> function cf key single value? meta value post ID Syntax Rules of language usage
  • 8. WordCamp Albuquerque 2013 | Ray Gulick, Evo 8 WordPress Tags PHP, but simpler, sort of; using functions that are part of core, saving a lot of coding for WP designer/developers. <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <h1><?php the_title(); ?></h1> <?php the_content('Read more'); ?> <?php endwhile; ?> <?php endif; ?>
  • 9. WordCamp Albuquerque 2013 | Ray Gulick, Evo 9 What are Custom Fields? WordPress has standard fields, such as: the_title the_content Templates display the values of the fields using the following tags: <?php the_title(); ?> <?php the_content(); ?>
  • 10. WordCamp Albuquerque 2013 | Ray Gulick, Evo 10 Custom fields are fields you define and display on templates using your own tags. You might create some custom fields with these custom field keys: pagepix pagepix_alt pagepix_caption Note: example code which follows assumes use of Advanced Custom Fields plugin to create/organize custom fields.
  • 11. WordCamp Albuquerque 2013 | Ray Gulick, Evo 11 Custom fields displayed on template with conditional code: <?php $pix = get_field('pagepix'); $alt = get_field('pagepix_alt'); $caption = get_field('pagepix_caption'); if (($pix) && ($alt)) { echo '<div class="pagepix">'; echo '<img src="'.$pix.'" alt="'.$alt.'" />'; if ($caption) { echo '<p>'.$caption.'</p>'; } echo '</div>'; } ?> Method used by ACF plugin
  • 12. WordCamp Albuquerque 2013 | Ray Gulick, Evo 12 If there is a value for each of the custom fields, this HTML is rendered: <div class="pagepix"> <img src="http://www.domain.com/wp-content/uploads/ imagename.jpg" alt="image description" /> <p>This is the caption for this image.</p> </div> It might be styled with this CSS: .pagepix {width:338px; float:right; margin:.5em 0 .2em 18px;} .pagepix img {width:338px !important;} .pagepix p {font-size:12px; color:#666; margin:3px 0;} which leads us to:
  • 13. WordCamp Albuquerque 2013 | Ray Gulick, Evo 13 The most important* thing about custom fields: Custom fields can add content into pre-formatted areas. Means there is no need for the CMS user to be concerned with style, or for the web designer to be concerned about how the website will look two weeks after launch. *somewhat biased opinion
  • 14. WordCamp Albuquerque 2013 | Ray Gulick, Evo 14 Custom fields are great! 1. Allow faster, simpler website updates for CMS users 2. Allow designer more control of look and feel and more consistency in presentation 3. But...
  • 15. WordCamp Albuquerque 2013 | Ray Gulick, Evo 15 The problem with custom fields is the WordPress user interface. 1. Field keys listed alphabetically; difficult to group related fields 2. No clues about what kind of info we want for the value
  • 16. WordCamp Albuquerque 2013 | Ray Gulick, Evo 16 Advanced Custom Fields plugin 1. User-friendly metabox title 2. User-friendly field label (no field key) 3. Hints above entry field
  • 17. WordCamp Albuquerque 2013 | Ray Gulick, Evo 17 Control where ACF metaboxes appear, and to whom they appear. Place metaboxes on edit screens based on Post Type (incl. Custom Post Types), Page Template, Page Parent, Taxonomies, User Role, and other criteria.
  • 18. WordCamp Albuquerque 2013 | Ray Gulick, Evo 18 Lots of options for field type, then further customization of selected field type. ACF Field Type Options!!!
  • 19. WordCamp Albuquerque 2013 | Ray Gulick, Evo 19 Why Custom Post Types? With a custom post type, you can: 1. Specify which standard metaboxes appear on the post type create/edit screens (title, editor, excerpt) 2. Create custom fields specifically for the post type, grouped in metaboxes that only appear on the post type add/edit screen (ACF) 3. Create templates specifically needed for custom post type content
  • 20. WordCamp Albuquerque 2013 | Ray Gulick, Evo 20 Register CPT in theme’s functions.php file: add_action('init', 'create_custom_post_types'); function create_custom_post_types() { register_post_type('news', array('labels' => array( 'name' => __('News Items'), 'singular_name' => __('News Item'), 'add_new' => __('Add New'), 'add_new_item' => __('Add News Item'), 'edit' => __('Edit'), 'edit_item' => __('Edit News Item'), 'new_item' => __('New News Item'), 'view' => __('View News Items'), 'view_item' => __('View News Item'), 'search_items' => __('Search News Items'), 'not_found' => __('No News Items found'), 'not_found_in_trash' => __('No News Items found in Trash'), ), CPT name
  • 21. WordCamp Albuquerque 2013 | Ray Gulick, Evo 21 'menu_icon' => get_stylesheet_directory_uri(). '/images/newspaper.png', 'public' => true, 'show_ui' => true, 'publicly_queryable' => true, 'exclude_from_search' => false, 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => array('slug' => 'news-item', 'with_front' => false), 'query_var' => true, 'supports' => array('title', 'editor', 'excerpt') ) ); flush_rewrite_rules(); } SLUG
  • 22. WordCamp Albuquerque 2013 | Ray Gulick, Evo 22 Important stuff about CPTs 1. The “slug” cannot be the same as the CPT name. 2. CPTs display on a template named single-cptname.php (i.e., single-news.php) 3. Single template must contain appropriate code to display the custom fields you want to display in the CPT. 4. CPT listings are created with post type queries placed on a “listings” page template.
  • 23. WordCamp Albuquerque 2013 | Ray Gulick, Evo 23 page_newslist.php (page template)
  • 24. WordCamp Albuquerque 2013 | Ray Gulick, Evo 24 WP_Query for ‘news’ CPT Listing <?php $paged = ( get_query_var('paged')) ? get_query_var('paged') : 1; $newslist = new WP_Query ( array( 'post_type' => 'news', 'posts_per_page' => 5, 'paged' => $paged )); if ($newslist->have_posts()) : while ($newslist->have_posts()) : $newslist->the_post(); ?> <div class="excerpt"> <?php the_title( '<h2><a href="'.get_permalink().'">', '</a>&raquo;</h2>' ); ?> <p class="newsdate"><?php the_time('n/j/y'); ?> &ndash;</p> <?php the_excerpt(); ?> </div> <?php endwhile; endif; if(function_exists('wp_pagenavi')) wp_pagenavi( array( 'query' => $newslist ) ); ?>
  • 25. WordCamp Albuquerque 2013 | Ray Gulick, Evo 25 single-news.php
  • 26. WordCamp Albuquerque 2013 | Ray Gulick, Evo 26 <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <article class="pagecontent"> <h1><?php the_title(); ?></h1> <?php get_template_part('pix');?> <p class="newsdate"><?php the_time('n/j/y'); ?> &ndash;</p> <?php the_content('Read more'); ?> </article> <?php endwhile; ?> <?php endif; ?> Display CPT content on News single template (single-news.php)
  • 27. WordCamp Albuquerque 2013 | Ray Gulick, Evo 27 Learn more http://www.php.net/manual/en/index.php http://codex.wordpress.org/Custom_Fields http://wordpress.org/extend/plugins/advanced-custom-fields/ http://codex.wordpress.org/Function_Reference/register_post_type http://justintadlock.com/archives/2010/04/29/custom-post-types-in- wordpress http://codex.wordpress.org/Class_Reference/WP_Query http://wordpress.stackexchange.com http://generatewp.com/
  • 28. WordCamp Albuquerque 2013 | Ray Gulick, Evo 28 Questions? ?? ??? ?