SlideShare uma empresa Scribd logo
1 de 22
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

Mais conteúdo relacionado

Mais procurados

GDI - Intro to WordPress
GDI - Intro to WordPressGDI - Intro to WordPress
GDI - Intro to WordPress
Suzette Franck
 

Mais procurados (20)

CSS Mastigado
CSS MastigadoCSS Mastigado
CSS Mastigado
 
Introduction of wordpress, Wordpress Training Ahmedabad, Wordpress Class Ahme...
Introduction of wordpress, Wordpress Training Ahmedabad, Wordpress Class Ahme...Introduction of wordpress, Wordpress Training Ahmedabad, Wordpress Class Ahme...
Introduction of wordpress, Wordpress Training Ahmedabad, Wordpress Class Ahme...
 
Sass - Getting Started with Sass!
Sass - Getting Started with Sass!Sass - Getting Started with Sass!
Sass - Getting Started with Sass!
 
CSS Dasar #1 : Intro
CSS Dasar #1 : IntroCSS Dasar #1 : Intro
CSS Dasar #1 : Intro
 
CSS Dasar #6 : Background
CSS Dasar #6 : BackgroundCSS Dasar #6 : Background
CSS Dasar #6 : Background
 
CSS Grid vs. Flexbox
CSS Grid vs. FlexboxCSS Grid vs. Flexbox
CSS Grid vs. Flexbox
 
¡Hola flexbox! Adiós float...
¡Hola flexbox! Adiós float...¡Hola flexbox! Adiós float...
¡Hola flexbox! Adiós float...
 
Html tutorials
Html tutorialsHtml tutorials
Html tutorials
 
CSS For Backend Developers
CSS For Backend DevelopersCSS For Backend Developers
CSS For Backend Developers
 
CSS corso base (classi seconde, mod 1)
CSS corso base (classi seconde, mod 1)CSS corso base (classi seconde, mod 1)
CSS corso base (classi seconde, mod 1)
 
CSS Dasar #7 : Selector
CSS Dasar #7 : SelectorCSS Dasar #7 : Selector
CSS Dasar #7 : Selector
 
0x02-HTML.pdf
0x02-HTML.pdf0x02-HTML.pdf
0x02-HTML.pdf
 
WordPress Webinar Training Presentation
WordPress Webinar Training PresentationWordPress Webinar Training Presentation
WordPress Webinar Training Presentation
 
WordPress SEO & Optimisation
WordPress SEO & OptimisationWordPress SEO & Optimisation
WordPress SEO & Optimisation
 
CSS
CSSCSS
CSS
 
Introduction to Wordpress
Introduction to WordpressIntroduction to Wordpress
Introduction to Wordpress
 
Specificity and CSS Selectors
Specificity and CSS SelectorsSpecificity and CSS Selectors
Specificity and CSS Selectors
 
SEO - On Page | Off Page | Deep Linking | Link Building | Articles |Blogs | C...
SEO - On Page | Off Page | Deep Linking | Link Building | Articles |Blogs | C...SEO - On Page | Off Page | Deep Linking | Link Building | Articles |Blogs | C...
SEO - On Page | Off Page | Deep Linking | Link Building | Articles |Blogs | C...
 
GDI - Intro to WordPress
GDI - Intro to WordPressGDI - Intro to WordPress
GDI - Intro to WordPress
 
WordPress 1.pdf
WordPress 1.pdfWordPress 1.pdf
WordPress 1.pdf
 

Semelhante a Wordpress theme development

Word press bootcamp By Sourcescript Innovations and Mentors Dojo
Word press bootcamp  By Sourcescript Innovations and Mentors DojoWord press bootcamp  By Sourcescript Innovations and Mentors Dojo
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
lightshire
 
How to get your theme in WordPress
How to get your theme in WordPressHow to get your theme in WordPress
How to get your theme in WordPress
Nisha Singh
 
American University WordPress Theming Lecture
American University WordPress Theming LectureAmerican University WordPress Theming Lecture
American University WordPress Theming Lecture
Aaron Brazell
 

Semelhante a Wordpress theme development (20)

Wordpress template hierarchy
Wordpress template hierarchyWordpress template hierarchy
Wordpress template hierarchy
 
Starting WordPress Theme Review
Starting WordPress Theme ReviewStarting WordPress Theme Review
Starting WordPress Theme Review
 
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
Word press bootcamp  By Sourcescript Innovations and Mentors DojoWord press bootcamp  By Sourcescript Innovations and Mentors Dojo
Word press bootcamp By Sourcescript Innovations and Mentors Dojo
 
WordPress Themes and Plugins
WordPress Themes and PluginsWordPress Themes and Plugins
WordPress Themes and Plugins
 
WCBos13 intermediate workshop
WCBos13 intermediate workshopWCBos13 intermediate workshop
WCBos13 intermediate workshop
 
Introduction to Custom WordPress Themeing
Introduction to Custom WordPress ThemeingIntroduction to Custom WordPress Themeing
Introduction to Custom WordPress Themeing
 
Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016
 
Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25Newbies guide to customizing word press themes 25
Newbies guide to customizing word press themes 25
 
Theme Development: From an idea to getting approved to wordpress.org
Theme Development: From an idea to getting approved to wordpress.orgTheme Development: From an idea to getting approved to wordpress.org
Theme Development: From an idea to getting approved to wordpress.org
 
How to get your theme in WordPress
How to get your theme in WordPressHow to get your theme in WordPress
How to get your theme in WordPress
 
Anatomy of a Wordpress theme
Anatomy of a Wordpress themeAnatomy of a Wordpress theme
Anatomy of a Wordpress theme
 
Keeping Your Themes and Plugins Organized.
Keeping Your Themes and Plugins Organized.Keeping Your Themes and Plugins Organized.
Keeping Your Themes and Plugins Organized.
 
Writing a WordPress Theme - HighEdWeb 2013 #WRK2
Writing a WordPress Theme - HighEdWeb 2013 #WRK2Writing a WordPress Theme - HighEdWeb 2013 #WRK2
Writing a WordPress Theme - HighEdWeb 2013 #WRK2
 
American University WordPress Theming Lecture
American University WordPress Theming LectureAmerican University WordPress Theming Lecture
American University WordPress Theming Lecture
 
Intro To WordPress Themes
Intro To WordPress ThemesIntro To WordPress Themes
Intro To WordPress Themes
 
MCC Web Design Workshop
MCC Web Design WorkshopMCC Web Design Workshop
MCC Web Design Workshop
 
Submitting to the WordPress Theme Directory
Submitting to the WordPress Theme DirectorySubmitting to the WordPress Theme Directory
Submitting to the WordPress Theme Directory
 
Websites With Wordpress
Websites With WordpressWebsites With Wordpress
Websites With Wordpress
 
WordPress Template hierarchy
WordPress Template hierarchyWordPress Template hierarchy
WordPress Template hierarchy
 
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slidesKeep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slides
 

Mais de Naeem Junejo (6)

Freelancing
FreelancingFreelancing
Freelancing
 
Introduction databases and MYSQL
Introduction databases and MYSQLIntroduction databases and MYSQL
Introduction databases and MYSQL
 
WordPress theme setting page
WordPress theme setting pageWordPress theme setting page
WordPress theme setting page
 
Introduction To WordPress
Introduction To WordPressIntroduction To WordPress
Introduction To WordPress
 
jQuery Mobile
jQuery MobilejQuery Mobile
jQuery Mobile
 
Wordpress custom-posttype
Wordpress custom-posttypeWordpress custom-posttype
Wordpress custom-posttype
 

Último

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Último (20)

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 

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