SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Wordpress Template
    Hierarchy
     Keith Lockhart
Topics

•   Base Templates - Yoast

    Worpress Template Hierarchy
•   Tips and Tricks

    Wordpress on the Mac - if we have time...
Wordpress Theme
               Anatomy blog works
    Cheat sheet for how your

•   Wordpress themes are made up of a folder
    of template files, each of which controls a
    specific piece of your theme.

    Every page has header, sidebar and footer
    files.
•   You can alter the files so that they show
    specific data depending on the page you are
    on.
Deprecated
Template Files Within Template
             Files
•   You have seen how WordPress includes standard
    template files (header, footer, and sidebar) within the
    index.php template file. You can also include other
    template files within any of your template files.

    For example, sidebar.php might contain a template
    file that generates a search form — searchform.php.
    Because this is not one of WordPress's standard
    template files, the code to include it is a little
    different:

•   <?php get_search_form(); ?>

    We should no longer be using include and
    TEMPLATEPATH to get our search forms into themes
    as WordPress supplies the above template tag.
•   Most WordPress Themes include a variety of
    template files within other templates to generate
      Template Files - index.php
    the web pages on the site. The following template
    files are typical for the main template (index.php) of
    a WordPress site:

    header.php

•   theloop.php (The Content)

•   wp-comments.php

    sidebar.php

•   searchform.php

•   footer.php

    However, this structure can be changed. For instance,
    you could put the search form in your header.
    Perhaps your design does not need a footer, so you
    could leave that template out entirely.
Special Template Files


•   WordPress features two core page views of web
    pages in a WordPress site. The single post view is
    used when the web pages displays a single post. The
    multi-post view lists multiple posts or post summaries,
    and applies to category archives, date archives,
    author archives, and (usually) the "normal" view of
    your blog's home page. You can use the index.php
    template file to generate all of these types of pages
    or rely on WordPress' template hierarchy to choose
    different template files depending on the situation.
What template file will Wordpress use?
 •   What template file will WordPress use when a certain type
     of page is displayed?

     WordPress automatically recognizes template files with
     certain standard names and uses them for certain types of
     web pages. For example, when a user clicks on the title of a
     blog post, WordPress knows that they want to view just that
     article on its own web page. The WordPress
     template hierarchy will use the single.php template file
     rather than index.php to generate the page — if your Theme
     has a single.php file. Similarly, if the user clicks on a link for
     a particular category, WordPress will use the category.php
     template if it exists; if it doesn't, it looks for archive.php,
     and if that template is also missing, WordPress will go ahead
     and use the main index.php template. You can even make
     special template files for specific categories (see
     Category Templates for more information).
one and ending in the other.

    •
                 Template File Tips
        Eg. the html and body HTML elements typically begin in
        header.php and end in footer.php. Most WordPress themes
        make use of HTML div elements, which can also span
        several files. For instance, the main div for the page
        content might start in header.php and end in either
        index.php or single.php.

    •   Tracking down where an HTML element begins and ends
        can get complicated if you are
        developing, designing, or modifying a Theme. Use comments
        to note in the template files where a large container tag
        opens and where it closes so you can track which div is
        which at the end of different sections.

•   WordPress automatically recognizes template files with
    certain standard names and uses them for certain types of
    web pages. For example, when a user clicks on the title of a
    blog post, WordPress knows that they want to view just that
    article on its own web page. The WordPress
    template hierarchy will use the single.php template file
    rather than index.php to generate the page — if your Theme
    has a single.php file. Similarly, if the user clicks on a link for
    a particular category, WordPress will use the category.php
Tracking Opening and Closing Tags

•   Tracking down where an HTML element begins and
    ends can get complicated if you are
    developing, designing, or modifying a Theme. Use
    comments to note in the template files where a large
    container tag opens and where it closes so you can
    track which div is which at the end of different
    sections.

•   WordPress automatically recognizes template files
    with certain standard names and uses them for
    certain types of web pages. For example, when a user
    clicks on the title of a blog post, WordPress knows
    that they want to view just that article on its own
    web page.
Tracking Opening and Closing Tags
    The WordPress template hierarchy will use the
    single.php template file rather than index.php to
    generate the page — if your Theme has a single.php
    file.
•   Similarly, if the user clicks on a link for a
    particular category, WordPress will use the
    category.php template if it exists; if it doesn't, it
    looks for archive.php, and if that template is also
    missing, WordPress will go ahead and use the main
    index.php template.
•   You can even make special template files for
    specific categories (see Category Templates for
    more information).
Test Template Files Under Different
              Views



If you have made changes to the comments,
sidebar, search form, or any other template
file, make sure you test them using different
web page views (single post, different types
of archives, and pages).
Comment Deviations
•   If you are
    designing Themes for public release, keep in
    mind that someone who downloads your Theme
    will probably want to modify it slightly for
    their own use. So, it is helpful if you make
    notes in your template files where you have
    made changes from the logic of the Default
    and/or Classic Themes. It is also a good idea
    to add comments in your Theme's main style
    file if you have style information elsewhere
    (such as in your header.php file or in HTML
    tags).
Close the Tag Door Behind You

•   If you start a HTML tag or div in one template
    file and don't close it there, make sure you
    include the closing tag in another template file.
•   The WordPress Forum gets a lot of questions
    about "what happened to my theme" when they
    remove the footer template file without closing
    the tags that began in the header template
    file. Track down your tags and make sure they
    are closed. (A good way to verify that this is
    correct is to test your single and archive page
    views with an HTML validator).
CSS Styles in Templates




•   You are free to use whatever HTML and CSS
    tags and styles you like in your templates.
    However, you are encouraged to follow the
    standard WordPress theme structure (see
    Site Architecture 1.5). This will make your
    Themes more understandable to your users.
Wordpress on the Mac

•   Best platform - Coda - Panic Software - $100

        Version 2.0 just released
•   Blogging Adjunct
    •   Marsedit - Red-Sweater Software - $40

    Text Editors
    •   Textmate - Macromates - $40 V2 in
        gestation

        BBEdit - v10 - Barebones $50

Weitere ähnliche Inhalte

Was ist angesagt?

Keeping Your Themes and Plugins Organized.
Keeping Your Themes and Plugins Organized.Keeping Your Themes and Plugins Organized.
Keeping Your Themes and Plugins Organized.Jacob Martella
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme developmentTammy Hart
 
WordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteWordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteBrendan Sera-Shriar
 
HTML Start Up - Introduction to HTML
HTML Start Up - Introduction to HTMLHTML Start Up - Introduction to HTML
HTML Start Up - Introduction to HTMLGrayzon Gonzales, LPT
 
Towards an Alternate WordPress Theme Structure
Towards an Alternate WordPress Theme StructureTowards an Alternate WordPress Theme Structure
Towards an Alternate WordPress Theme StructureGraham Armfield
 
Using Custom Post Types and Advanced Custom Fields with Elementor
 Using Custom Post Types and Advanced Custom Fields with Elementor Using Custom Post Types and Advanced Custom Fields with Elementor
Using Custom Post Types and Advanced Custom Fields with ElementorAngela Bowman
 
Content-Driven WordPress Development - WordCamp Omaha 2014
Content-Driven WordPress Development - WordCamp Omaha 2014Content-Driven WordPress Development - WordCamp Omaha 2014
Content-Driven WordPress Development - WordCamp Omaha 2014Stephanie Eckles
 
Web1O1 - Intro to HTML/CSS
Web1O1 - Intro to HTML/CSSWeb1O1 - Intro to HTML/CSS
Web1O1 - Intro to HTML/CSSNYCSS Meetup
 
WordPress Theme Design - Rich Media Institute Workshop
WordPress Theme Design - Rich Media Institute WorkshopWordPress Theme Design - Rich Media Institute Workshop
WordPress Theme Design - Rich Media Institute WorkshopBrendan Sera-Shriar
 
WordPress Theme Development for Designers
WordPress Theme Development for DesignersWordPress Theme Development for Designers
WordPress Theme Development for Designerselliotjaystocks
 
Introduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentIntroduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentSitdhibong Laokok
 
Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)christopherfross
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalChandra Prakash Thapa
 
Becoming a Respected WordPress Developer
Becoming a Respected WordPress DeveloperBecoming a Respected WordPress Developer
Becoming a Respected WordPress DeveloperDavid Wolfpaw
 
WordPress Custom Post Types
WordPress Custom Post TypesWordPress Custom Post Types
WordPress Custom Post TypesNile Flores
 
WordPress Theme Development
WordPress Theme DevelopmentWordPress Theme Development
WordPress Theme DevelopmentWisdmLabs
 

Was ist angesagt? (20)

W pthemes
W pthemesW pthemes
W pthemes
 
Keeping Your Themes and Plugins Organized.
Keeping Your Themes and Plugins Organized.Keeping Your Themes and Plugins Organized.
Keeping Your Themes and Plugins Organized.
 
Custom WordPress theme development
Custom WordPress theme developmentCustom WordPress theme development
Custom WordPress theme development
 
BASICS OF HTML
BASICS OF HTMLBASICS OF HTML
BASICS OF HTML
 
WordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media InstituteWordPress 2.5 Overview - Rich Media Institute
WordPress 2.5 Overview - Rich Media Institute
 
HTML Start Up - Introduction to HTML
HTML Start Up - Introduction to HTMLHTML Start Up - Introduction to HTML
HTML Start Up - Introduction to HTML
 
Towards an Alternate WordPress Theme Structure
Towards an Alternate WordPress Theme StructureTowards an Alternate WordPress Theme Structure
Towards an Alternate WordPress Theme Structure
 
WordPress plugins
WordPress pluginsWordPress plugins
WordPress plugins
 
Using Custom Post Types and Advanced Custom Fields with Elementor
 Using Custom Post Types and Advanced Custom Fields with Elementor Using Custom Post Types and Advanced Custom Fields with Elementor
Using Custom Post Types and Advanced Custom Fields with Elementor
 
Content-Driven WordPress Development - WordCamp Omaha 2014
Content-Driven WordPress Development - WordCamp Omaha 2014Content-Driven WordPress Development - WordCamp Omaha 2014
Content-Driven WordPress Development - WordCamp Omaha 2014
 
Web1O1 - Intro to HTML/CSS
Web1O1 - Intro to HTML/CSSWeb1O1 - Intro to HTML/CSS
Web1O1 - Intro to HTML/CSS
 
WordPress Theme Design - Rich Media Institute Workshop
WordPress Theme Design - Rich Media Institute WorkshopWordPress Theme Design - Rich Media Institute Workshop
WordPress Theme Design - Rich Media Institute Workshop
 
WordPress Theme Development for Designers
WordPress Theme Development for DesignersWordPress Theme Development for Designers
WordPress Theme Development for Designers
 
Intro to HTML
Intro to HTMLIntro to HTML
Intro to HTML
 
Introduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentIntroduction to WordPress Theme Development
Introduction to WordPress Theme Development
 
Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)
 
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 NepalWordPress theme development from scratch : ICT MeetUp 2013 Nepal
WordPress theme development from scratch : ICT MeetUp 2013 Nepal
 
Becoming a Respected WordPress Developer
Becoming a Respected WordPress DeveloperBecoming a Respected WordPress Developer
Becoming a Respected WordPress Developer
 
WordPress Custom Post Types
WordPress Custom Post TypesWordPress Custom Post Types
WordPress Custom Post Types
 
WordPress Theme Development
WordPress Theme DevelopmentWordPress Theme Development
WordPress Theme Development
 

Ähnlich wie Wordpress template hierarchy

Wordpress theme development
Wordpress theme developmentWordpress theme development
Wordpress theme developmentNaeem Junejo
 
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 Dojolightshire
 
WordPress Template hierarchy
WordPress Template hierarchyWordPress Template hierarchy
WordPress Template hierarchyJason Yingling
 
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 25New Tricks
 
Anatomy of a Wordpress theme
Anatomy of a Wordpress themeAnatomy of a Wordpress theme
Anatomy of a Wordpress themeDave Wallace
 
MCC Web Design Workshop
MCC Web Design WorkshopMCC Web Design Workshop
MCC Web Design WorkshopFaye Tandog
 
Starting WordPress Theme Review
Starting WordPress Theme ReviewStarting WordPress Theme Review
Starting WordPress Theme ReviewCatch Themes
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...LinnAlexandra
 
How to customise Joomla
How to customise JoomlaHow to customise Joomla
How to customise JoomlaTim Plummer
 
The Flexibility of WordPress
The Flexibility of WordPressThe Flexibility of WordPress
The Flexibility of WordPressStephanie Eckles
 
WordPress Theme Workshop: Part 1
WordPress Theme Workshop: Part 1WordPress Theme Workshop: Part 1
WordPress Theme Workshop: Part 1David Bisset
 
WordPress Themes and Plugins
WordPress Themes and PluginsWordPress Themes and Plugins
WordPress Themes and Pluginssuperann
 
Your First Wordpress Theme
Your First Wordpress ThemeYour First Wordpress Theme
Your First Wordpress Themesayed fathey
 
Open Source CMS Playroom
Open Source CMS PlayroomOpen Source CMS Playroom
Open Source CMS Playroomlibrarywebchic
 
Wordpress website development
Wordpress website developmentWordpress website development
Wordpress website developmentJohn Faust
 
Intro To WordPress Themes
Intro To WordPress ThemesIntro To WordPress Themes
Intro To WordPress Themesdamonsharp
 
WordPress A CMS for Beginners, Geeks and Those In-Between
WordPress A CMS for Beginners, Geeks and Those In-BetweenWordPress A CMS for Beginners, Geeks and Those In-Between
WordPress A CMS for Beginners, Geeks and Those In-BetweenHeidi Cool
 
WordPress Bootcamp Part 3 - Themes
WordPress Bootcamp Part 3 - ThemesWordPress Bootcamp Part 3 - Themes
WordPress Bootcamp Part 3 - ThemesMetronet
 

Ähnlich wie Wordpress template hierarchy (20)

Wordpress theme development
Wordpress theme developmentWordpress theme development
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
 
WordPress Template hierarchy
WordPress Template hierarchyWordPress Template hierarchy
WordPress Template hierarchy
 
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
 
Anatomy of a Wordpress theme
Anatomy of a Wordpress themeAnatomy of a Wordpress theme
Anatomy of a Wordpress theme
 
WordPress Theming 101
WordPress Theming 101WordPress Theming 101
WordPress Theming 101
 
MCC Web Design Workshop
MCC Web Design WorkshopMCC Web Design Workshop
MCC Web Design Workshop
 
Starting WordPress Theme Review
Starting WordPress Theme ReviewStarting WordPress Theme Review
Starting WordPress Theme Review
 
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
Don't Fear the Custom Theme: How to build a custom WordPress theme with only ...
 
Wordpress overview
Wordpress overviewWordpress overview
Wordpress overview
 
How to customise Joomla
How to customise JoomlaHow to customise Joomla
How to customise Joomla
 
The Flexibility of WordPress
The Flexibility of WordPressThe Flexibility of WordPress
The Flexibility of WordPress
 
WordPress Theme Workshop: Part 1
WordPress Theme Workshop: Part 1WordPress Theme Workshop: Part 1
WordPress Theme Workshop: Part 1
 
WordPress Themes and Plugins
WordPress Themes and PluginsWordPress Themes and Plugins
WordPress Themes and Plugins
 
Your First Wordpress Theme
Your First Wordpress ThemeYour First Wordpress Theme
Your First Wordpress Theme
 
Open Source CMS Playroom
Open Source CMS PlayroomOpen Source CMS Playroom
Open Source CMS Playroom
 
Wordpress website development
Wordpress website developmentWordpress website development
Wordpress website development
 
Intro To WordPress Themes
Intro To WordPress ThemesIntro To WordPress Themes
Intro To WordPress Themes
 
WordPress A CMS for Beginners, Geeks and Those In-Between
WordPress A CMS for Beginners, Geeks and Those In-BetweenWordPress A CMS for Beginners, Geeks and Those In-Between
WordPress A CMS for Beginners, Geeks and Those In-Between
 
WordPress Bootcamp Part 3 - Themes
WordPress Bootcamp Part 3 - ThemesWordPress Bootcamp Part 3 - Themes
WordPress Bootcamp Part 3 - Themes
 

Kürzlich hochgeladen

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Kürzlich hochgeladen (20)

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Wordpress template hierarchy

  • 1. Wordpress Template Hierarchy Keith Lockhart
  • 2. Topics • Base Templates - Yoast Worpress Template Hierarchy • Tips and Tricks Wordpress on the Mac - if we have time...
  • 3. Wordpress Theme Anatomy blog works Cheat sheet for how your • Wordpress themes are made up of a folder of template files, each of which controls a specific piece of your theme. Every page has header, sidebar and footer files. • You can alter the files so that they show specific data depending on the page you are on.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 15. Template Files Within Template Files • You have seen how WordPress includes standard template files (header, footer, and sidebar) within the index.php template file. You can also include other template files within any of your template files. For example, sidebar.php might contain a template file that generates a search form — searchform.php. Because this is not one of WordPress's standard template files, the code to include it is a little different: • <?php get_search_form(); ?> We should no longer be using include and TEMPLATEPATH to get our search forms into themes as WordPress supplies the above template tag.
  • 16. Most WordPress Themes include a variety of template files within other templates to generate Template Files - index.php the web pages on the site. The following template files are typical for the main template (index.php) of a WordPress site: header.php • theloop.php (The Content) • wp-comments.php sidebar.php • searchform.php • footer.php However, this structure can be changed. For instance, you could put the search form in your header. Perhaps your design does not need a footer, so you could leave that template out entirely.
  • 17. Special Template Files • WordPress features two core page views of web pages in a WordPress site. The single post view is used when the web pages displays a single post. The multi-post view lists multiple posts or post summaries, and applies to category archives, date archives, author archives, and (usually) the "normal" view of your blog's home page. You can use the index.php template file to generate all of these types of pages or rely on WordPress' template hierarchy to choose different template files depending on the situation.
  • 18. What template file will Wordpress use? • What template file will WordPress use when a certain type of page is displayed? WordPress automatically recognizes template files with certain standard names and uses them for certain types of web pages. For example, when a user clicks on the title of a blog post, WordPress knows that they want to view just that article on its own web page. The WordPress template hierarchy will use the single.php template file rather than index.php to generate the page — if your Theme has a single.php file. Similarly, if the user clicks on a link for a particular category, WordPress will use the category.php template if it exists; if it doesn't, it looks for archive.php, and if that template is also missing, WordPress will go ahead and use the main index.php template. You can even make special template files for specific categories (see Category Templates for more information).
  • 19. one and ending in the other. • Template File Tips Eg. the html and body HTML elements typically begin in header.php and end in footer.php. Most WordPress themes make use of HTML div elements, which can also span several files. For instance, the main div for the page content might start in header.php and end in either index.php or single.php. • Tracking down where an HTML element begins and ends can get complicated if you are developing, designing, or modifying a Theme. Use comments to note in the template files where a large container tag opens and where it closes so you can track which div is which at the end of different sections. • WordPress automatically recognizes template files with certain standard names and uses them for certain types of web pages. For example, when a user clicks on the title of a blog post, WordPress knows that they want to view just that article on its own web page. The WordPress template hierarchy will use the single.php template file rather than index.php to generate the page — if your Theme has a single.php file. Similarly, if the user clicks on a link for a particular category, WordPress will use the category.php
  • 20. Tracking Opening and Closing Tags • Tracking down where an HTML element begins and ends can get complicated if you are developing, designing, or modifying a Theme. Use comments to note in the template files where a large container tag opens and where it closes so you can track which div is which at the end of different sections. • WordPress automatically recognizes template files with certain standard names and uses them for certain types of web pages. For example, when a user clicks on the title of a blog post, WordPress knows that they want to view just that article on its own web page.
  • 21. Tracking Opening and Closing Tags The WordPress template hierarchy will use the single.php template file rather than index.php to generate the page — if your Theme has a single.php file. • Similarly, if the user clicks on a link for a particular category, WordPress will use the category.php template if it exists; if it doesn't, it looks for archive.php, and if that template is also missing, WordPress will go ahead and use the main index.php template. • You can even make special template files for specific categories (see Category Templates for more information).
  • 22. Test Template Files Under Different Views If you have made changes to the comments, sidebar, search form, or any other template file, make sure you test them using different web page views (single post, different types of archives, and pages).
  • 23. Comment Deviations • If you are designing Themes for public release, keep in mind that someone who downloads your Theme will probably want to modify it slightly for their own use. So, it is helpful if you make notes in your template files where you have made changes from the logic of the Default and/or Classic Themes. It is also a good idea to add comments in your Theme's main style file if you have style information elsewhere (such as in your header.php file or in HTML tags).
  • 24. Close the Tag Door Behind You • If you start a HTML tag or div in one template file and don't close it there, make sure you include the closing tag in another template file. • The WordPress Forum gets a lot of questions about "what happened to my theme" when they remove the footer template file without closing the tags that began in the header template file. Track down your tags and make sure they are closed. (A good way to verify that this is correct is to test your single and archive page views with an HTML validator).
  • 25. CSS Styles in Templates • You are free to use whatever HTML and CSS tags and styles you like in your templates. However, you are encouraged to follow the standard WordPress theme structure (see Site Architecture 1.5). This will make your Themes more understandable to your users.
  • 26. Wordpress on the Mac • Best platform - Coda - Panic Software - $100 Version 2.0 just released • Blogging Adjunct • Marsedit - Red-Sweater Software - $40 Text Editors • Textmate - Macromates - $40 V2 in gestation BBEdit - v10 - Barebones $50