Lorelle VanFossen presents "WordPress and PHP," a quick review of how WordPress uses PHP from the core to design to WordPress Plugins. Presented originally at Clark College in Vancouver, Washington, for their PHP class, this presentation helps students understand the importance of PHP in WordPress. It also features the skill sets critical to learning WordPress from a coding and design perspective, and what it takes to become a WordPress developer and designer.
3. 25% of all sites on the web are published on WordPress
The latest version of WordPress has been downloaded almost 20
million times.
Median hourly wage of a WordPress project is $50.
Typical salary range for US web industry position with WordPress
dev/design experience is $55-74K. Mobile experience, add $5-10K.
oDesk reports an average of 5,500 WordPress jobs posted a month.
WordPress runs The New York Times, Wall Street Journal sites,
Ford, NY University Library, CNN, Harvard Law School, Ben & Jerry,
People Magazine, NASA, Time Magazine, GE, MTV Newsroom,
BBC Top Gear, National Geographic, TechCrunch, BoingBoing, AIGA
Portland, The Economist, Comedy.com, Mozilla, Wired, Samsung, Le
Monde Newspaper, Lexus, Nikon Pressroom, Official Star Wars
Blog, Kobe Bryant, Carnival Cruise Line, Jay-Z…
4. • The core of WordPress is built on PHP
• WordPress Themes:
• WordPress Template Tags: Make WordPress go
• WordPress Template Files: Make WordPress pretty
• WordPress Functions.php file: Code in Design
• WordPress Plugins
• Push the boundaries of WordPress
• Separate code from design
5. • Ingredients:
• 6 cups HTML/XHTML/HTML5
• 8 cups CSS/CSS3
• 1/2 cup JavaScript
• 12 cups PHP
• 7 cups WordPress Template Tags
• 1 tablespoon common sense
Mix all ingredients into WordPress Template Files. Add
MySQL data and process through the WordPress Loop.
Add code from the functions.php file. Mix well. Season with
WordPress Plugins and GPL.
7. <?php bloginfo('name'); ?>
<?php bloginfo('description'); ?>
<?php bloginfo('url'); ?>
<p>Powered by WordPress version
<?php bloginfo('version'); ?></p>
Powered by WordPress version 3.4
13. <!-- Start the Loop. -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- The following tests if the current post is in category 3. If it is, the div box is given the CSS class "post-cat-
three". Otherwise, the div box will be given the CSS class "post". -->
<?php if ( in_category('3') ) { ?>
<div class="post-cat-three">
<?php } else { ?>
<div class="post">
<?php } ?>
<!-- Display the Title as a link to the Post's permalink. -->
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php
the_title(); ?></a></h2>
<!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
<small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>
<!-- Display the Post's Content in a div box. -->
<div class="entry">
<?php the_content(); ?>
</div>
<!-- Display a comma separated list of the Post's Categories. -->
<p class="postmetadata">Posted in <?php the_category(', '); ?></p>
</div> <!-- closes the first div box -->
<!-- Stop The Loop (but note the "else:" - see next line). -->
<?php endwhile; else: ?>
<!-- The very first "if" tested to see if there were any Posts to display -->
<p>Sorry, no posts matched your criteria.</p>
<!-- REALLY stop The Loop. -->
<?php endif; ?>
14. <!-- Start the Loop. -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- The following tests if the current post is in category 3. If it is, the div box is given the CSS class "post-cat-
three". Otherwise, the div box will be given the CSS class "post". -->
<?php if ( in_category('3') ) { ?>
<div class="post-cat-three">
<?php } else { ?>
<?php } ?>
<div class="post"> WordPress Function Tags
<!-- Display the Title as a link to the Post's permalink. -->
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php
the_title(); ?></a></h2>
<!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
<small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>
<!-- Display the Post's Content in a div box. -->
<div class="entry">
<?php the_content(); ?>
</div>
<!-- Display a comma separated list of the Post's Categories. -->
<p class="postmetadata">Posted in <?php the_category(', '); ?></p>
</div> <!-- closes the first div box -->
<!-- Stop The Loop (but note the "else:" - see next line). -->
<?php endwhile; else: ?>
<!-- The very first "if" tested to see if there were any Posts to display -->
<p>Sorry, no posts matched your criteria.</p>
<!-- REALLY stop The Loop. -->
<?php endif; ?>
15. <!-- Start the Loop. -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- The following tests if the current post is in category 3. If it is, the div box is given the CSS class "post-cat-
three". Otherwise, the div box will be given the CSS class "post". -->
<?php if ( in_category('3') ) { ?>
<div class="post-cat-three">
<?php } else { ?>
<div class="post">
<?php } ?>
<!-- Display the Title as a link to the Post's permalink. -->
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php
the_title(); ?></a></h2>
<!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
<small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>
<!-- Display the Post's Content in a div box. -->
<div class="entry">
<?php the_content(); ?>
</div>
<!-- Display a comma separated list of the Post's Categories. -->
<p class="postmetadata">Posted in <?php the_category(', '); ?></p>
</div> <!-- closes the first div box -->
<!-- Stop The Loop (but note the "else:" - see next line). -->
<?php endwhile; else: ?>
<!-- The very first "if" tested to see if there were any Posts to display -->
<p>Sorry, no posts matched your criteria.</p>
<!-- REALLY stop The Loop. -->
<?php endif; ?>
16. <!-- Start the Loop. -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- The following tests if the current post is in category 3. If it is, the div box is given the CSS class "post-cat-
three". Otherwise, the div box will be given the CSS class "post". -->
<?php if ( in_category('3') ) { ?>
<div class="post-cat-three">
<?php } else { ?>
<div class="post">
<?php } ?>
<!-- Display the Title as a link to the Post's permalink. -->
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php
the_title(); ?></a></h2>
<!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
<small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>
<!-- Display the Post's Content in a div box. -->
<div class="entry">
<?php the_content(); ?>
</div>
<!-- Display a comma separated list of the Post's Categories. -->
<p class="postmetadata">Posted in <?php the_category(', '); ?></p>
</div> <!-- closes the first div box -->
<!-- Stop The Loop (but note the "else:" - see next line). -->
<?php endwhile; else: ?>
<!-- The very first "if" tested to see if there were any Posts to display -->
<p>Sorry, no posts matched your criteria.</p>
<!-- REALLY stop The Loop. -->
<?php endif; ?>
17. • Modular elements create a WordPress Theme
• Code and data called with template tags, functions,
conditional tags, and post queries
• Automatic and customizable hierarchy
header.php
If pageview is single and in category 3,
show sidebar 2.
index.php If pageview is category, show sidebar 3
single.php If pageview is front, show sidebar on
sidebar. left.
page.php
category.php
php If category view requested,
archive.php automatically switch to category
template file.
footer.php
19. • Protect original files
• Allow protected customization
• Use CSS !important inheritance.
• Child Theme code overrides Parent
Theme code.
• Child Theme customization lost
with Theme change.
20. • Template file strictly for adding code customization.
• Uses WordPress Hooks to extend:
• Parent Theme elements
• WordPress Administration Screens
• Attaches to specific Theme, not all Themes.
• Theme functions.php lost when changing Themes.
<!– - Set excerpt length from default to 200 words - - >
function custom_excerpt_length( $length ) {
return 200;
}
add_filter( 'excerpt_length', 'custom_excerpt_length',
999 );
21. • Add options to Administration Panels
(backend)
• Theme options
• Change user interface
• Add functionality
22. Power of WordPress Themes
Twenty-Eleven WordPress Theme
Built-in Customizations
23. • Extend WordPress Theme design and functionality
• Preserve function with Theme switches
• Extend WordPress Administration Screens
24. NextGEN Gallery
My Blog’s Building Blocks
BuddyPress
XML Sitemap
Generator
@lorelleonwp
WordPress.com Stats
25. Talk Like a Pirate Day
September 19, 2012
Text Filter Suite
WordPress Plugin WRP-Cards
WordPress Plugin
US Department of
Homeland Insecurity
Idiocy Level for WordPress
Suicide Squirrel Threat
Advisory System
Related Ways to Take Action
CSS Naked Day
WordPress Plugin
Annually in April
26. This Plugin is useful for those that want
their blog to out-live them, and serve as
an online memorial. Even without use of
this Plugin, all are recommended to
make sure someone can handle their
website in case of emergency.
Tags: afterlife, death, will
38. A New Plugin For Your New WordPress Version
The latest WordPress version was launched. Yes,
WordPress 3.0 was already available and ready to
optimize for our blog. Indeed, WordPress is always
the best blogging platform for me and I believe for
many other blogger. However, as in title, I will
introduce you with a great WordPress Plugin which
I believe perfectly match with WordPress 3.0. It can
be said as a new plugin for a new WordPress blog.
41. • Test in variety of environments and start early.
• TEST TEST TEST TEST TEST.
• Know your licenses (understand GPL thoroughly)
• Be ready to update fixes immediately.
• Make it brain-dead stupid to use.
• Add version numbers EVERYWHERE including
database option arrays.
• Ask users the version number.
• URL Bugs: Embrace https, subdomains, subwebs.
42. • Prepare for feedback
• Your site clearly shows links to Plugins and expertise
• WordPress Plugin Directory
• WordPress Support Forums
• Promote and Monitor
• WordPress Support Forums
• Google Search
• Twitter
• Facebook
• Stackoverflow
• oDesk
• Never assume.
• Listen, Listen, Listen, LISTEN DAMN IT!
45. • Code, Web, and Accessibility Standards
• PHP 5+
• JavaScript, AJAX, jQuery
• Apache/Unix basics
• HTML/CSS
• XML
• API
• Trac/Subversion
• Mobile
47. • Only full college credit WordPress course in the world.
• Overview of WordPress publishing and content
management platform
• Content development
• Layout and design
• WordPress Themes
• WordPress Plugins
• Underlying technologies
Tues & Thurs
• Interactivity 6-8:30 PM
• Social web integration July 3 – August 23
ITEM # 1867