SlideShare a Scribd company logo
2
Most read
11
Most read
13
Most read
THEME DEVELOPMENT IN
WORDPRESS
By:
Junejo Naeem Ahmed
WHY WORDPRESS THEMES?
• To create a unique look for your WordPress site .
• To take advantage of templates, template tags, and
the WordPress Loop to generate different website
results and looks .
• To provide alternative templates for specific site
features, such as category pages and search result
pages .
• To quickly switch between two site layouts, or to take
advantage of a Theme or style switcher to allow site
owners to change the look of your site .
A WORDPRESS THEME HAS MANY BENEFITS, TOO .
• It separates the presentation styles and template
files from the system files so the site will upgrade
without drastic changes to the visual presentation of
the site.
• It allows for customization of the site functionality
unique to that Theme.
• It allows for quick changes of the visual design and
layout of a WordPress site.
• It removes the need for a typical WordPress site
owner to have to learn CSS, HTML, and PHP in order
to have a great-looking website .
WHY SHOULD YOU BUILD YOUR OWN WORDPRESS
THEME? THAT'S THE REAL QUESTION.

• It's an opportunity to learn more about
CSS, HTML, and PHP.
• It's an opportunity to put your expertise with
CSS, HTML, and PHP to work.
• It's creative.
• It's fun (most of the time).
• If you release it to the public, you can feel
good that you shared and gave something
back to the WordPress Community
THEME DEVELOPMENT STANDARDS
• WordPress Themes should be coded using the
following standards:
• Use well-structured, error-free PHP and valid
HTML. ( WordPress Coding Standards ).
• Use clean, valid CSS. ( CSS Coding Standards ).
• Follow design guidelines in Site Design and
Layout .
ANATOMY OF A THEME
• WordPress Themes live in subdirectories of the WordPress
themes directory (wp-content/themes/ by default).
• The Theme's subdirectory holds all of the Theme's stylesheet
files, template files, and optional functions file
(functions.php), JavaScript files, and images.
• For example, a Theme named "test" would reside in the
directory wp-content/themes/test/.
• Avoid using numbers for the theme name, as this prevents it
from being displayed in the available themes list.
• WordPress includes a default theme in each new installation.
Examine the files in the default theme carefully to get a better
idea of how to build your own Theme files.
THEME STYLESHEET
• In addition to CSS style information for your theme, style.css
provides details about the Theme in the form of comments.
• The stylesheet must provide details about the Theme in the
form of comments.
• No two Themes are allowed to have the same details listed in
their comment headers.
• If you make your own Theme by copying an existing one,
make sure you change this information first.
THEME STYLESHEET (Cont’d)
FUNCTIONS FILE
• A theme can optionally use a functions file, which resides in
the theme subdirectory and is named functions.php.
• This file basically acts like a plugin, and if it is present in the
theme you are using, it is automatically loaded during
WordPress initialization (both for admin pages and external
pages).
• Enable Theme Features such as Sidebars, Navigation
Menus, Post Thumbnails, Post Formats, Custom
Headers, Custom Backgrounds and others.
• Set up an options menu, giving site owners options for
colors, styles, and other aspects of your theme.
WHAT IS A TEMPLATE TAG
• A template tag is code that instructs WordPress to
"do" or "get" something.
• In the case of the header.php template tag for your
WordPress site's name, it looks like this:
• <h1><?php bloginfo('name'); ?></h1>
TEMPLATE TAG -bloginfo
• Displays information about your site, mostly gathered from
the information you supply in your User Profile and General
Settings WordPress Administration Screens.
• It can be used anywhere within a template file.
• This always prints a result to the browser.
• If you need the values for use in PHP, use get_bloginfo().

• Usage
– <?php bloginfo( $show ); ?>

• Parameters
– $show(string) (Optional) Keyword naming the information you want.
– Default: name
HOW TO PASS TAG PARAMETERS
• like PHP functions, many template tags accept arguments, or
parameters.
• Template tag parameters are variables you can use to change
a tag's output or otherwise modify its action in some way.
• Tags without parameters
• Tags with PHP function-style parameters
– Some functions take multiple parameters.
– Multiple parameters are separated by commas.
– The order of parameters is important!

• Tags with query-string-style parameters
INCLUDE TAGS
• The Template include tags are used within one Template file
to execute the HTML and PHP found in another template file.
• Include Generic Files
–
–
–
–

get_header()
get_footer()
get_sidebar()
get_template_part()

• Include Other Components
– get_search_form()
– comments_template()
CONDITIONAL TAGS
• All of the Conditional Tags test to see whether a certain
condition is met, and then returns either TRUE or FALSE.
–
–
–
–

Is_home()
Is_single();
Is_admin();
Is_category();
HOW WORDPRESS WORKS
• Visitors requests initial WordPress page: index.php
• WordPress activates themes
• WordPress checks to see which template files are
present
• Gathers settings stored in database
• Retrieves specified number of most recent posts
• Stores post data
(title, author, content, comments, etc.) in variables
• Outputs data into theme page
BASIC WORDPRESS THEME PAGE STRUCTURE AND ELEMENTS

•
•
•
•
•
•

Header (header.php)
Main content (index.php)
Sidebar with Widget (sidebar.php)
Footer (footer.php)
CSS (style.css)
The stylesheet called style.css, which controls the
presentation (visual design and layout) of the
website pages.
ANATOMY OF A THEME
THE 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.
• Any HTML or PHP code in the Loop will be processed
on each post.
THE LOOP: VISIUAL MODEL
ADDITIONAL WORDPRESS TEMPLATE FILES
•
•
•
•
•

Archive (archive.php)
Custom Page (page.php)
Single Post (single.php)
Comments (comments.php)
Search Results (search.php)
THE ARCHIVE TEMPATE FILE
•
•
•
•
•
•
•
•

archive.php
Fall back for 6 different page types:
Author
Tag
Category
Taxonomy
Date
Archives
THE CUSTOM PAGE TEMPATE FILE
• page.php
• Used to create all custom pages
• Additional custom page template can be created

More Related Content

PPTX
WordPress Theme Development
PDF
WordPress Theme Development
PDF
Wordpress CMS tutorial and guide manual
PPSX
Wordpress Development Introduction
PDF
How to Grow your Organic Search Traffic in International Markets #ConnectaBern
PPTX
WordPress Security for Beginners
PPT
CSS Introduction
PPTX
Regular Expressions for Regular Joes (and SEOs)
WordPress Theme Development
WordPress Theme Development
Wordpress CMS tutorial and guide manual
Wordpress Development Introduction
How to Grow your Organic Search Traffic in International Markets #ConnectaBern
WordPress Security for Beginners
CSS Introduction
Regular Expressions for Regular Joes (and SEOs)

What's hot (20)

PDF
planejamento HTM5 e CSS3
PPT
An Introduction to CSS Preprocessors (SASS & LESS)
PPSX
Introduction of wordpress, Wordpress Training Ahmedabad, Wordpress Class Ahme...
PDF
Alice Phieu - WordPress For Beginners
PPTX
Introduction to WordPress
PPTX
Web design
PDF
SEO proposal
PPT
SEO For Developers
PDF
HTML.pdf
PPTX
Technical seo tips for web developers
PDF
TDC2015: Testes em APIs REST com Rest-Assured
PDF
WordPress what is Wordpress
PDF
Developing Technical SEO Skills - Brighton SEO Sept 2021
PPTX
Basic seo
PPTX
How Search Works
PPTX
6 Months SEO Plan for an ecommerce firm
PPT
PPTX
Basic WordPress Workshop Presentation
PDF
Dynamic Rendering - is this really an SEO silver bullet? SMX WEST
planejamento HTM5 e CSS3
An Introduction to CSS Preprocessors (SASS & LESS)
Introduction of wordpress, Wordpress Training Ahmedabad, Wordpress Class Ahme...
Alice Phieu - WordPress For Beginners
Introduction to WordPress
Web design
SEO proposal
SEO For Developers
HTML.pdf
Technical seo tips for web developers
TDC2015: Testes em APIs REST com Rest-Assured
WordPress what is Wordpress
Developing Technical SEO Skills - Brighton SEO Sept 2021
Basic seo
How Search Works
6 Months SEO Plan for an ecommerce firm
Basic WordPress Workshop Presentation
Dynamic Rendering - is this really an SEO silver bullet? SMX WEST
Ad

Similar to Wordpress theme development (20)

PPT
Wordpress template hierarchy
PPTX
Starting WordPress Theme Review
PPTX
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
PPTX
WordPress Themes and Plugins
PPTX
WCBos13 intermediate workshop
PPTX
Introduction to Custom WordPress Themeing
PPTX
Responsive themeworkshop wcneo2016
PDF
Newbies guide to customizing word press themes 25
PDF
Theme Development: From an idea to getting approved to wordpress.org
PPTX
How to get your theme in WordPress
PDF
Anatomy of a Wordpress theme
PPTX
Keeping Your Themes and Plugins Organized.
PPTX
Writing a WordPress Theme - HighEdWeb 2013 #WRK2
KEY
American University WordPress Theming Lecture
KEY
Intro To WordPress Themes
PPTX
MCC Web Design Workshop
PDF
Submitting to the WordPress Theme Directory
PPTX
Websites With Wordpress
PPTX
WordPress Template hierarchy
PDF
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Wordpress template hierarchy
Starting WordPress Theme Review
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
WordPress Themes and Plugins
WCBos13 intermediate workshop
Introduction to Custom WordPress Themeing
Responsive themeworkshop wcneo2016
Newbies guide to customizing word press themes 25
Theme Development: From an idea to getting approved to wordpress.org
How to get your theme in WordPress
Anatomy of a Wordpress theme
Keeping Your Themes and Plugins Organized.
Writing a WordPress Theme - HighEdWeb 2013 #WRK2
American University WordPress Theming Lecture
Intro To WordPress Themes
MCC Web Design Workshop
Submitting to the WordPress Theme Directory
Websites With Wordpress
WordPress Template hierarchy
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Ad

More from Naeem Junejo (6)

PPTX
Freelancing
PPTX
Introduction databases and MYSQL
PPTX
WordPress theme setting page
PPTX
Introduction To WordPress
PPTX
jQuery Mobile
PPTX
Wordpress custom-posttype
Freelancing
Introduction databases and MYSQL
WordPress theme setting page
Introduction To WordPress
jQuery Mobile
Wordpress custom-posttype

Recently uploaded (20)

PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Cell Types and Its function , kingdom of life
PPTX
Cell Structure & Organelles in detailed.
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
RMMM.pdf make it easy to upload and study
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
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
VCE English Exam - Section C Student Revision Booklet
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Basic Mud Logging Guide for educational purpose
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
O5-L3 Freight Transport Ops (International) V1.pdf
Anesthesia in Laparoscopic Surgery in India
Cell Types and Its function , kingdom of life
Cell Structure & Organelles in detailed.
Week 4 Term 3 Study Techniques revisited.pptx
TR - Agricultural Crops Production NC III.pdf
01-Introduction-to-Information-Management.pdf
Supply Chain Operations Speaking Notes -ICLT Program
O7-L3 Supply Chain Operations - ICLT Program
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
RMMM.pdf make it easy to upload and study
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPH.pptx obstetrics and gynecology in nursing
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
VCE English Exam - Section C Student Revision Booklet
Microbial diseases, their pathogenesis and prophylaxis
Basic Mud Logging Guide for educational purpose

Wordpress theme development

  • 2. WHY WORDPRESS THEMES? • To create a unique look for your WordPress site . • To take advantage of templates, template tags, and the WordPress Loop to generate different website results and looks . • To provide alternative templates for specific site features, such as category pages and search result pages . • To quickly switch between two site layouts, or to take advantage of a Theme or style switcher to allow site owners to change the look of your site .
  • 3. A WORDPRESS THEME HAS MANY BENEFITS, TOO . • It separates the presentation styles and template files from the system files so the site will upgrade without drastic changes to the visual presentation of the site. • It allows for customization of the site functionality unique to that Theme. • It allows for quick changes of the visual design and layout of a WordPress site. • It removes the need for a typical WordPress site owner to have to learn CSS, HTML, and PHP in order to have a great-looking website .
  • 4. WHY SHOULD YOU BUILD YOUR OWN WORDPRESS THEME? THAT'S THE REAL QUESTION. • It's an opportunity to learn more about CSS, HTML, and PHP. • It's an opportunity to put your expertise with CSS, HTML, and PHP to work. • It's creative. • It's fun (most of the time). • If you release it to the public, you can feel good that you shared and gave something back to the WordPress Community
  • 5. THEME DEVELOPMENT STANDARDS • WordPress Themes should be coded using the following standards: • Use well-structured, error-free PHP and valid HTML. ( WordPress Coding Standards ). • Use clean, valid CSS. ( CSS Coding Standards ). • Follow design guidelines in Site Design and Layout .
  • 6. ANATOMY OF A THEME • WordPress Themes live in subdirectories of the WordPress themes directory (wp-content/themes/ by default). • The Theme's subdirectory holds all of the Theme's stylesheet files, template files, and optional functions file (functions.php), JavaScript files, and images. • For example, a Theme named "test" would reside in the directory wp-content/themes/test/. • Avoid using numbers for the theme name, as this prevents it from being displayed in the available themes list. • WordPress includes a default theme in each new installation. Examine the files in the default theme carefully to get a better idea of how to build your own Theme files.
  • 7. THEME STYLESHEET • In addition to CSS style information for your theme, style.css provides details about the Theme in the form of comments. • The stylesheet must provide details about the Theme in the form of comments. • No two Themes are allowed to have the same details listed in their comment headers. • If you make your own Theme by copying an existing one, make sure you change this information first.
  • 9. FUNCTIONS FILE • A theme can optionally use a functions file, which resides in the theme subdirectory and is named functions.php. • This file basically acts like a plugin, and if it is present in the theme you are using, it is automatically loaded during WordPress initialization (both for admin pages and external pages). • Enable Theme Features such as Sidebars, Navigation Menus, Post Thumbnails, Post Formats, Custom Headers, Custom Backgrounds and others. • Set up an options menu, giving site owners options for colors, styles, and other aspects of your theme.
  • 10. WHAT IS A TEMPLATE TAG • A template tag is code that instructs WordPress to "do" or "get" something. • In the case of the header.php template tag for your WordPress site's name, it looks like this: • <h1><?php bloginfo('name'); ?></h1>
  • 11. TEMPLATE TAG -bloginfo • Displays information about your site, mostly gathered from the information you supply in your User Profile and General Settings WordPress Administration Screens. • It can be used anywhere within a template file. • This always prints a result to the browser. • If you need the values for use in PHP, use get_bloginfo(). • Usage – <?php bloginfo( $show ); ?> • Parameters – $show(string) (Optional) Keyword naming the information you want. – Default: name
  • 12. HOW TO PASS TAG PARAMETERS • like PHP functions, many template tags accept arguments, or parameters. • Template tag parameters are variables you can use to change a tag's output or otherwise modify its action in some way. • Tags without parameters • Tags with PHP function-style parameters – Some functions take multiple parameters. – Multiple parameters are separated by commas. – The order of parameters is important! • Tags with query-string-style parameters
  • 13. INCLUDE TAGS • The Template include tags are used within one Template file to execute the HTML and PHP found in another template file. • Include Generic Files – – – – get_header() get_footer() get_sidebar() get_template_part() • Include Other Components – get_search_form() – comments_template()
  • 14. CONDITIONAL TAGS • All of the Conditional Tags test to see whether a certain condition is met, and then returns either TRUE or FALSE. – – – – Is_home() Is_single(); Is_admin(); Is_category();
  • 15. HOW WORDPRESS WORKS • Visitors requests initial WordPress page: index.php • WordPress activates themes • WordPress checks to see which template files are present • Gathers settings stored in database • Retrieves specified number of most recent posts • Stores post data (title, author, content, comments, etc.) in variables • Outputs data into theme page
  • 16. BASIC WORDPRESS THEME PAGE STRUCTURE AND ELEMENTS • • • • • • Header (header.php) Main content (index.php) Sidebar with Widget (sidebar.php) Footer (footer.php) CSS (style.css) The stylesheet called style.css, which controls the presentation (visual design and layout) of the website pages.
  • 17. ANATOMY OF A THEME
  • 18. THE 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. • Any HTML or PHP code in the Loop will be processed on each post.
  • 20. ADDITIONAL WORDPRESS TEMPLATE FILES • • • • • Archive (archive.php) Custom Page (page.php) Single Post (single.php) Comments (comments.php) Search Results (search.php)
  • 21. THE ARCHIVE TEMPATE FILE • • • • • • • • archive.php Fall back for 6 different page types: Author Tag Category Taxonomy Date Archives
  • 22. THE CUSTOM PAGE TEMPATE FILE • page.php • Used to create all custom pages • Additional custom page template can be created