SlideShare a Scribd company logo
WordPress Theme
Workshop: Part 4
November 4th, 2017
David Bisset
davidbisset.com / @dimensionmedia
UnderStrap
http://underscores.me/
Creating A Homepage
Let’s just get a homepage going! Time to create!
• Create: home.php
• Adding css to style.css
Updating A Footer
Want to get rid of someone’s copyright? :-)
• Modify: footer.php
• Adding css to style.css
The Sidebar
header.php - This file will contain the code for the header section of the theme;
index.php - This is the main file for the theme. It will contain the code for the Main
Area and will specify where the other files will be included;
sidebar.php - This file will contain the information about the sidebar;
footer.php - This file will handle your footer;
style.css - This file will handle the styling of your new theme;
Theme Frameworks
Also Sometimes Known As “Starter Themes”
A theme framework as the core or foundation of a theme,
which allows users to create their own child themes even if
they have little or no experience in coding.
(See Email For List Of Theme Frameworks - Paid and Free)
What Is Underscores or _s?
Ultra-Minimal CSS theme
• A just right amount of lean, well-commented, modern, HTML5 templates.
• A helpful 404 template.
• A custom header implementation in inc/custom-header.php just add the
code snippet found in the comments of inc/custom-header.php to your
header.php template.
• Custom template tags in inc/template-tags.php that keep your templates
clean and neat and prevent code duplication.
• Some small tweaks in inc/template-functions.php that can improve your
theming experience.
• A script at js/navigation.js that makes your menu a toggled dropdown on
small screens (like your phone), ready for CSS artistry. It's enqueued in
functions.php.
• 2 sample CSS layouts in layouts/ for a sidebar on either side of your
content.
• Smartly organized starter CSS in style.css that will help you to quickly get
your design off the ground.
Download And Install _s Theme
http://underscores.me/
Download And Install _s Theme
http://underscores.me/
Why Is It Blank? No Screenshot.png
http://underscores.me/
Screenshot For Your Theme!
The screenshot should be
named screenshot.png, and
should be placed in the top
level directory.
The recommended image
size is 1200px wide by
900px tall.
Looking At _S Theme Structure
Common Files
header.php - This file will contain the code for the header section of the theme;
index.php - This is the main file for the theme. It will contain the code for the Main
Area and will specify where the other files will be included;
sidebar.php - This file will contain the information about the sidebar;
footer.php - This file will handle your footer;
style.css - This file will handle the styling of your new theme;
Template Tags
For example, the template tag get_header() tells
WordPress to get the header.php file and include it in the
current theme file. Similarly, get_footer() tells WordPress
to get the footer.php file.
Template Tags
For example, the template tag get_header() tells
WordPress to get the header.php file and include it in the
current theme file. Similarly, get_footer() tells WordPress
to get the footer.php file.
Let’s Take A Closer Look!
Common Functions: wp_head();
Found in: header.php
Common Functions: wp_head();
Found in: header.php
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-
scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<?php wp_head(); ?>
</head>
Common Functions: wp_footer();
Found in: footer.php
Common Functions: wp_footer();
Found in: footer.php
</div><!-- #content -->
<footer id="colophon" class="site-footer">
<div class="site-info">
<a href="<?php echo esc_url( __( 'https://wordpress.org/', 'workshop-theme' ) ); ?
>"><?php
/* translators: %s: CMS name, i.e.WordPress. */
printf( esc_html__( 'Proudly powered by %s', 'workshop-theme' ),
'WordPress' );
?></a>
<span class="sep"> | </span>
<?php
/* translators: 1:Theme name, 2:Theme author. */
printf( esc_html__( 'Theme: %1$s by %2$s.', 'workshop-theme' ), 'workshop-
theme', '<a href="http://davidbisset.com">David Bisset</a>' );
?>
</div><!-- .site-info -->
</footer><!-- #colophon -->
</div><!-- #page -->
<?php wp_footer(); ?>
</body>
</html>
Common Functions: get_header();
Most Of Your Template Pages InYour Theme
/* 404.php */
<?php get_header(); ?>
<h2>Error 404 - Not Found</h2>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
https://codex.wordpress.org/Function_Reference/get_header
Common Functions: get_footer();
Most Of Your Template Pages InYour Theme
/* 404.php */
<?php get_header(); ?>
<h2>Error 404 - Not Found</h2>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
https://codex.wordpress.org/Function_Reference/get_footer
Common Functions: get_sidebar();
Most Of Your Template Pages InYour Theme
/* 404.php */
<?php get_header(); ?>
<h2>Error 404 - Not Found</h2>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
https://codex.wordpress.org/Function_Reference/get_sidebar
The WordPress “Loop”
The Loop is PHP code used by WordPress to display posts.
Using The Loop,WordPress processes each post to be
displayed on the current page, and formats it according to
how it matches specified criteria within The Loop tags.
The WordPress “Loop”
<?php
get_header();
if (have_posts()) :
while (have_posts()) :
the_post();
the_content();
endwhile;
endif;
get_sidebar();
get_footer();
?>
The WordPress “Loop”
<?php
get_header();
if (have_posts()) :
while (have_posts()) :
the_post();
the_content();
endwhile;
endif;
get_sidebar();
get_footer();
?>
The WordPress “Loop”
<?php
get_header();
if (have_posts()) :
while (have_posts()) :
the_post();
the_content();
endwhile;
endif;
get_sidebar();
get_footer();
?>
it checks whether any posts were discovered
If there were any posts, let’s do this until
there are no more
“loads up” the post and it’s data
The the_content() template tag fetches
the content of the post, filters it, and
then displays it.
The WordPress “Loop”
<?php
get_header();
if (have_posts()) :
while (have_posts()) :
the_post(); ?>
<article>
<?php the_content(); ?>
</article>
<?php
endwhile;
endif;
get_sidebar();
get_footer();
?>
The WordPress “Loop”
<?php
get_header();
if (have_posts()) :
while (have_posts()) :
the_post(); ?>
<article>
<?php the_content(); ?>
</article>
<?php
endwhile;
endif;
get_sidebar();
get_footer();
_s single.php
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main">
<?php
while ( have_posts() ) : the_post();
get_template_part( 'template-parts/content', get_post_type() );
the_post_navigation();
// If comments are open or we have at least one comment, load up the comment
template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
endwhile; // End of the loop.
?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_sidebar();
get_footer();
get_template_part()
<?php get_template_part( 'partials/content', 'page' ); ?>

More Related Content

PDF
WordPress Theme Workshop: Part 1
PDF
WordPress Theme Workshop: Part 0
PDF
WCLV - Introduction to child themes
PPTX
HTML/CSS for WordPress
ODP
Choosing Themes
PPTX
Keeping Your Themes and Plugins Organized.
PDF
Theme Wrangling 101
PDF
WordPress Themes Demystified
WordPress Theme Workshop: Part 1
WordPress Theme Workshop: Part 0
WCLV - Introduction to child themes
HTML/CSS for WordPress
Choosing Themes
Keeping Your Themes and Plugins Organized.
Theme Wrangling 101
WordPress Themes Demystified

What's hot (19)

ODP
Meetup child-themes
PPTX
Installing WordPress The Right Way
PPT
Custom Menu Support for WordPress Themes
ODP
Meetup child-themes
PPTX
Building the basics (WordPress Ottawa 2014)
PPTX
WP 101 - Custom Fields & Post Types
PPTX
Web 101 intro to html
PPT
WordPress 101
PPTX
WP 101 - WordPress Basics
PPTX
The Basics of WordPress
PDF
What Is WordPress and Why Should I Use It? - Workshop April 2015
PDF
Cain & Obenland — Episode 4
PDF
WordPress Meetup Bandung - December 2014
PDF
Introduction to WordPress Child Themes
PPTX
WordPress best practices by billrice
PPT
W pthemes
PPT
Basic WordPress SEO
PDF
Thinkful - Frontend Crash Course - Intro to HTML/CSS
PPTX
Theme frameworks & child themes
Meetup child-themes
Installing WordPress The Right Way
Custom Menu Support for WordPress Themes
Meetup child-themes
Building the basics (WordPress Ottawa 2014)
WP 101 - Custom Fields & Post Types
Web 101 intro to html
WordPress 101
WP 101 - WordPress Basics
The Basics of WordPress
What Is WordPress and Why Should I Use It? - Workshop April 2015
Cain & Obenland — Episode 4
WordPress Meetup Bandung - December 2014
Introduction to WordPress Child Themes
WordPress best practices by billrice
W pthemes
Basic WordPress SEO
Thinkful - Frontend Crash Course - Intro to HTML/CSS
Theme frameworks & child themes
Ad

Similar to WordPress Theme Workshop: Part 4 (20)

PDF
WordPress Theme Workshop: Part 3
PDF
WordPress Theming 101
ODP
Creating Themes
PDF
Crash Course in Theme Surgery
PPTX
WordPress Themes 101 - dotEduGuru Summit 2013
PDF
Arizona WP - Building a WordPress Theme
PPTX
Design todevelop
PPTX
WordPress Themes 101 - HighEdWeb New England 2013
PPTX
MCC Web Design Workshop
PPT
WordPress Theme Design - Rich Media Institute Workshop
PDF
Making WordPress Your Own: Theme Customization & Creation
PDF
Builing a WordPress Theme
PPTX
Introduction to Custom WordPress Themeing
PPTX
WordPress Themes and Plugins
PPTX
Writing a WordPress Theme - HighEdWeb 2013 #WRK2
PPTX
WordPress Themes 101 - PSUWeb13 Workshop
PDF
WordPress Theme Structure
PPTX
Theme development essentials columbus oh word camp 2012
PDF
Newbies guide to customizing word press themes 25
PPTX
Wordpress theme development
WordPress Theme Workshop: Part 3
WordPress Theming 101
Creating Themes
Crash Course in Theme Surgery
WordPress Themes 101 - dotEduGuru Summit 2013
Arizona WP - Building a WordPress Theme
Design todevelop
WordPress Themes 101 - HighEdWeb New England 2013
MCC Web Design Workshop
WordPress Theme Design - Rich Media Institute Workshop
Making WordPress Your Own: Theme Customization & Creation
Builing a WordPress Theme
Introduction to Custom WordPress Themeing
WordPress Themes and Plugins
Writing a WordPress Theme - HighEdWeb 2013 #WRK2
WordPress Themes 101 - PSUWeb13 Workshop
WordPress Theme Structure
Theme development essentials columbus oh word camp 2012
Newbies guide to customizing word press themes 25
Wordpress theme development
Ad

More from David Bisset (20)

PDF
WordPress Theme Workshop: Part 2
PDF
WordPress Theme Workshop: Customizer
PDF
WordPress Theme Workshop: CSS/JS
PDF
WordPress Theme Workshop: Internationalization
PDF
WordPress Theme Workshop: Misc
PDF
WordPress Theme Workshop: Widgets
PDF
WordPress Theme Workshop: Menus
PDF
WordPress Theme Workshop: Sidebars
PDF
WordPress Theme Workshop: Theme Setup
PPTX
BuddyPress & Higher Education
PDF
WordPress Meetup (Davie, FL) - Top 9 April 2016
PDF
WordCamp Tampa 2015
PDF
BuddyPress v4
PDF
WPSessions - Thinking Outside The Box With BuddyPress
PDF
SunShine PHP
PDF
Building Next Generation Applications With BuddyPress
PDF
Be a Part of Something Bigger: Get Involved with WordPress
PDF
WordPress Meetup - Top 9 September 2015
PDF
WordPress Miami Meetup: Top 9 (August 2015)
PDF
Getting Started With Grunt for WordPress Development
WordPress Theme Workshop: Part 2
WordPress Theme Workshop: Customizer
WordPress Theme Workshop: CSS/JS
WordPress Theme Workshop: Internationalization
WordPress Theme Workshop: Misc
WordPress Theme Workshop: Widgets
WordPress Theme Workshop: Menus
WordPress Theme Workshop: Sidebars
WordPress Theme Workshop: Theme Setup
BuddyPress & Higher Education
WordPress Meetup (Davie, FL) - Top 9 April 2016
WordCamp Tampa 2015
BuddyPress v4
WPSessions - Thinking Outside The Box With BuddyPress
SunShine PHP
Building Next Generation Applications With BuddyPress
Be a Part of Something Bigger: Get Involved with WordPress
WordPress Meetup - Top 9 September 2015
WordPress Miami Meetup: Top 9 (August 2015)
Getting Started With Grunt for WordPress Development

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPT
Teaching material agriculture food technology
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Empathic Computing: Creating Shared Understanding
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Modernizing your data center with Dell and AMD
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Cloud computing and distributed systems.
PPTX
A Presentation on Artificial Intelligence
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Big Data Technologies - Introduction.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
KodekX | Application Modernization Development
Review of recent advances in non-invasive hemoglobin estimation
Building Integrated photovoltaic BIPV_UPV.pdf
Teaching material agriculture food technology
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Empathic Computing: Creating Shared Understanding
“AI and Expert System Decision Support & Business Intelligence Systems”
Per capita expenditure prediction using model stacking based on satellite ima...
Modernizing your data center with Dell and AMD
Machine learning based COVID-19 study performance prediction
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Cloud computing and distributed systems.
A Presentation on Artificial Intelligence
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Big Data Technologies - Introduction.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Diabetes mellitus diagnosis method based random forest with bat algorithm

WordPress Theme Workshop: Part 4

  • 1. WordPress Theme Workshop: Part 4 November 4th, 2017 David Bisset davidbisset.com / @dimensionmedia
  • 3. Creating A Homepage Let’s just get a homepage going! Time to create! • Create: home.php • Adding css to style.css
  • 4. Updating A Footer Want to get rid of someone’s copyright? :-) • Modify: footer.php • Adding css to style.css
  • 5. The Sidebar header.php - This file will contain the code for the header section of the theme; index.php - This is the main file for the theme. It will contain the code for the Main Area and will specify where the other files will be included; sidebar.php - This file will contain the information about the sidebar; footer.php - This file will handle your footer; style.css - This file will handle the styling of your new theme;
  • 6. Theme Frameworks Also Sometimes Known As “Starter Themes” A theme framework as the core or foundation of a theme, which allows users to create their own child themes even if they have little or no experience in coding. (See Email For List Of Theme Frameworks - Paid and Free)
  • 7. What Is Underscores or _s? Ultra-Minimal CSS theme • A just right amount of lean, well-commented, modern, HTML5 templates. • A helpful 404 template. • A custom header implementation in inc/custom-header.php just add the code snippet found in the comments of inc/custom-header.php to your header.php template. • Custom template tags in inc/template-tags.php that keep your templates clean and neat and prevent code duplication. • Some small tweaks in inc/template-functions.php that can improve your theming experience. • A script at js/navigation.js that makes your menu a toggled dropdown on small screens (like your phone), ready for CSS artistry. It's enqueued in functions.php. • 2 sample CSS layouts in layouts/ for a sidebar on either side of your content. • Smartly organized starter CSS in style.css that will help you to quickly get your design off the ground.
  • 8. Download And Install _s Theme http://underscores.me/
  • 9. Download And Install _s Theme http://underscores.me/
  • 10. Why Is It Blank? No Screenshot.png http://underscores.me/
  • 11. Screenshot For Your Theme! The screenshot should be named screenshot.png, and should be placed in the top level directory. The recommended image size is 1200px wide by 900px tall.
  • 12. Looking At _S Theme Structure
  • 13. Common Files header.php - This file will contain the code for the header section of the theme; index.php - This is the main file for the theme. It will contain the code for the Main Area and will specify where the other files will be included; sidebar.php - This file will contain the information about the sidebar; footer.php - This file will handle your footer; style.css - This file will handle the styling of your new theme;
  • 14. Template Tags For example, the template tag get_header() tells WordPress to get the header.php file and include it in the current theme file. Similarly, get_footer() tells WordPress to get the footer.php file.
  • 15. Template Tags For example, the template tag get_header() tells WordPress to get the header.php file and include it in the current theme file. Similarly, get_footer() tells WordPress to get the footer.php file. Let’s Take A Closer Look!
  • 17. Common Functions: wp_head(); Found in: header.php <!doctype html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width, initial- scale=1"> <link rel="profile" href="http://gmpg.org/xfn/11"> <?php wp_head(); ?> </head>
  • 19. Common Functions: wp_footer(); Found in: footer.php </div><!-- #content --> <footer id="colophon" class="site-footer"> <div class="site-info"> <a href="<?php echo esc_url( __( 'https://wordpress.org/', 'workshop-theme' ) ); ? >"><?php /* translators: %s: CMS name, i.e.WordPress. */ printf( esc_html__( 'Proudly powered by %s', 'workshop-theme' ), 'WordPress' ); ?></a> <span class="sep"> | </span> <?php /* translators: 1:Theme name, 2:Theme author. */ printf( esc_html__( 'Theme: %1$s by %2$s.', 'workshop-theme' ), 'workshop- theme', '<a href="http://davidbisset.com">David Bisset</a>' ); ?> </div><!-- .site-info --> </footer><!-- #colophon --> </div><!-- #page --> <?php wp_footer(); ?> </body> </html>
  • 20. Common Functions: get_header(); Most Of Your Template Pages InYour Theme /* 404.php */ <?php get_header(); ?> <h2>Error 404 - Not Found</h2> <?php get_sidebar(); ?> <?php get_footer(); ?> https://codex.wordpress.org/Function_Reference/get_header
  • 21. Common Functions: get_footer(); Most Of Your Template Pages InYour Theme /* 404.php */ <?php get_header(); ?> <h2>Error 404 - Not Found</h2> <?php get_sidebar(); ?> <?php get_footer(); ?> https://codex.wordpress.org/Function_Reference/get_footer
  • 22. Common Functions: get_sidebar(); Most Of Your Template Pages InYour Theme /* 404.php */ <?php get_header(); ?> <h2>Error 404 - Not Found</h2> <?php get_sidebar(); ?> <?php get_footer(); ?> https://codex.wordpress.org/Function_Reference/get_sidebar
  • 23. The WordPress “Loop” The Loop is PHP code used by WordPress to display posts. Using The Loop,WordPress processes each post to be displayed on the current page, and formats it according to how it matches specified criteria within The Loop tags.
  • 24. The WordPress “Loop” <?php get_header(); if (have_posts()) : while (have_posts()) : the_post(); the_content(); endwhile; endif; get_sidebar(); get_footer(); ?>
  • 25. The WordPress “Loop” <?php get_header(); if (have_posts()) : while (have_posts()) : the_post(); the_content(); endwhile; endif; get_sidebar(); get_footer(); ?>
  • 26. The WordPress “Loop” <?php get_header(); if (have_posts()) : while (have_posts()) : the_post(); the_content(); endwhile; endif; get_sidebar(); get_footer(); ?> it checks whether any posts were discovered If there were any posts, let’s do this until there are no more “loads up” the post and it’s data The the_content() template tag fetches the content of the post, filters it, and then displays it.
  • 27. The WordPress “Loop” <?php get_header(); if (have_posts()) : while (have_posts()) : the_post(); ?> <article> <?php the_content(); ?> </article> <?php endwhile; endif; get_sidebar(); get_footer(); ?>
  • 28. The WordPress “Loop” <?php get_header(); if (have_posts()) : while (have_posts()) : the_post(); ?> <article> <?php the_content(); ?> </article> <?php endwhile; endif; get_sidebar(); get_footer();
  • 29. _s single.php get_header(); ?> <div id="primary" class="content-area"> <main id="main" class="site-main"> <?php while ( have_posts() ) : the_post(); get_template_part( 'template-parts/content', get_post_type() ); the_post_navigation(); // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || get_comments_number() ) : comments_template(); endif; endwhile; // End of the loop. ?> </main><!-- #main --> </div><!-- #primary --> <?php get_sidebar(); get_footer();