2. In this section, we’ll look at some advanced
theme topics.
Child Themes
User Interface (UI) Best Practices
Theme Unit Tests
validating the theme’s markup.
3. What is a Parent Theme?
What is Child Theme?
If you are making extensive customizations –
beyond styles and a few theme files – creating a
parent theme might be a better option than a
child theme. Creating a parent theme allows
you to avoid issues with deprecated code in the
future. This needs to be decided on a case-by-
case basis.
4. How to Create a Child Theme?
1. Create a child theme folder .
First, create a new folder in your themes
directory, located at wp-content/themes.
Create a stylesheet: style.css
The following information is required:
Theme Name – needs to be unique to your
theme
Template – the name of the parent theme
directory.
6. You may need to re-save your menu
from Appearance > Menus and theme options
(including background and header images)
after activating the child theme.
Adding Template Files ->any file you add to
your child theme will overwrite the same file
in the parent theme.
7. Internationalization
Child themes can be prepared for translation into
other languages by using the
WordPress Internationalization API.
To internationalize a child theme follow these steps:
1. Add a languages directory.
2. Add language files.
Load a textdomain
Use GetText functions to add i18n support for your
strings.
8. Logo Homepage Link
Descriptive Anchor Text
A bad example:
The best way to learn WordPress is to start using
it. To Download WordPress, click here.
A better example:
Download WordPress and start using it. That's the
best way to learn.
9. Style Links with Underlines
Different Link Colors
There are 3 other states that links can have:
hover, when a mouse is over an element
focus, similar to hover but for keyboard users
active, when a user is clicking on a link
Color Contrast
Sufficient Font Size
Associate Labels with Inputs
Placeholder Text in Forms
Descriptive Buttons
10. Use Included Libraries->Image Cropper, Jcrop
Standard JavaScript
jQuery
Including jQuery in your theme
Event Handling
Theme Testing
Theme Unit Test Data
Themes Unit Test.
14. Required Theme Files
style.css
Index.php
Comments.php
Screenshot.php
While these files are the only files required by the
theme review team for acceptance into the
WordPress.org theme directory, you may use other
template files.
15. Required Theme Files
style.css
Index.php
Comments.php
Screenshot.php
While these files are the only files required by the
theme review team for acceptance into the
WordPress.org theme directory, you may use other
template files.
16. Theme Unit Test
WordPress Settings
WordPress Beta Tester
Testing and debugging tools
Theme Check
Developer
Debug Bar
Log Deprecated Notices
Browser testing
Validation
17. The WordPress Theme Review Team provides and
maintains the theme review guidelines as part of
their task as WordPress Contributors and
Developers for the WordPress Theme Directory.
Get Involved:
The WordPress Theme Review Team is open to
anyone and is a great way to get a better
understanding of how themes are developed. To
become a member of the WordPress Theme Review
Team, read through the WordPress Theme Review
Team’s site.
18. Here’s a list
of requirements and recommendations for
your theme’s documentation.
Themes are required to provide end-user
documentation of any design limitations or
extraordinary installation/setup instructions.
Themes are recommended to include
a readme.txt file, using plugin directory’s
readme.txt markdown format. This
recommendation will soon become required.
19. Before themes are added to the WordPress Theme Directory,
they are closely reviewed by the Theme Review team to
make sure they adhere to basic guidelines. This
review ensures that WordPress users across the globe can
download themes that are high quality and secure.
Need Help?-> Developing with WordPress
Guidelines->Make sure you review the Theme Review
Guidelines before uploading a theme.
Testing With Sample Data
Uploading Your Theme
When you are ready to submit your theme for review, please
upload your theme ZIP at Themes > Upload. Future updates are
to be uploaded via the same page.
More information about the theme review process is
available on the Theme Review Team’s website.
21. This section contains lists of Template
Tags and Conditional Tags.
Template Tags are used in your Template Files
to display information dynamically or
otherwise customize your site.
Conditional Tags are a boolean data type that
can be used in your Template Files to alter the
display of content depending on the conditions
that the current page matches.
22. Template tags files are stored in the wp-includes
directory. The files have the suffix of “-template.php”
to distinguish them from other WordPress files. There
are 9 template tags files:
wp-includes/general-template.php
wp-includes/author-template.php
wp-includes/bookmark-template.php
wp-includes/category-template.php
wp-includes/comment-template.php
wp-includes/link-template.php
wp-includes/post-template.php
wp-includes/post-thumbnail-template.php
wp-includes/nav-menu-template.php
23. General tags
Author tags
Category tags
Comment tags
Link tags
Post tags
Post Thumbnail tags
Navigation Menu tags
24. Eg:of Conditional Tags:
is_front_page()
is_home()
is_author()
is_date()
is_day()
is_time()
is_new_day()
is_archive()
is_search()
Note: You can only use conditional query tags after
the WP_Query is set up or with action hook.
26. This list of credits is taken from revisions as pages
are migrated over.
@ancawonka
@Anthonynotes
@atachibana
@austingunter
@BandonRandon
@BFTrick
@BigActual
@bkozma
@boborchard
@vrm