Joe Casabona • Web Developer. Writer. Nerd*. – *Computer, Device, Star Wars • Yankee Fan • Responsive Design with WordPress – Out Dec 2013 – www.rwdwp.com – Discount Code for 35% off: RWDWP site: Casabona.org | twitter: @jcasabona | email: joe @ casabona.org slides/resources: casabona.org/events/blogcon-13
Presented By: Joe Casabona and Phil Erb Track: Technology Session Format: Co-Presentation Description: WordPress is one of the most popular blogging platforms used today and if you’re using it already, you already know its benefits – but let’s take things a step further. In this session, Joe and Phil will dive into how to customize your WordPress blog and theme so that it reflects your brand and serves up your content in the best ways possible, ways to make your WordPress blog more secure (and how to monitor it so that it stays that way!), and other techniques and technologies to make the most of this content management system.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Joe Casabona
• Web Developer. Writer. Nerd*. – *Computer, Device, Star Wars
• Yankee Fan
• Responsive Design with WordPress– Out Dec 2013– www.rwdwp.com– Discount Code for 35% off: RWDWP
• Place misc PHP functions, code, and variables• Considered a “plugin” file for your theme• Remember “Separation of Concerns”– Themes should only effect display, not content or
functionality • Uses: Actions, Filters, side-wide functions• RWD Tip: Use this file for server-side
detection
index.php
• The backbone of WordPress themes
• Everything that doesn’t have its own template file will use index.php
• Used to display a list of posts or content.
• DO NOT remove The Loop from this page
header.php and footer.php
• Template Files to use throughout the theme
• get_header() and get_footer()
• wp_head() and wp_footer()
The WordPress Hierarchy
wphierarchy.com
Template Files
• Sophisticated Display Controls• Only required files: style.css and index.php• Custom templates down to the single post
level• Example: Custom Post Type named“classes”
single-classes.php single.php index.php
Page Templates
• Naming Convention– page-no-sidebar.php
<?php/*Template Name: No Sidebar*/
?>
The Loop
Defined
• The Loop is used by WordPress to display each of your posts. Using the Loop, WordPress processes each of the posts to be displayed on the current page and formats them according to how they match specified criteria within the Loop tags. Any HTML or PHP code placed in the Loop will be repeated on each post
Essentially…
• The Loop has functions to: – Make sure that you have posts to display– Display those posts.
<?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>
//print post information using template tags<?php endwhile; ?>
<?php else : ?>print “No posts found.”;
<?php endif; ?>
Template Tags
• Functions in WordPress designed to print information about the Current Post
• Some tags include:– the_title(), the_time(), the_content(),
• WPMU.org: Why You Should Never Search For Free WordPress Themeshttp://wpmu.org/why-you-should-never-search-for-free-wordpress-themes-in-google-or-anywhere-else/