SlideShare uma empresa Scribd logo
1 de 48
The Art and Science of WordPress Theme Development
Best Practices
OENOLOGY
=== OENOLOGY ===
• Contributors: Chip Bennett
• Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-
xclick&hosted_button_id=QP3N9HUSYJPK6
• Tags: fixed-width, white, black, blue, red, tan, green, one-column, two-columns, three-columns, custom-header, custom-
background, custom-menu, editor-style, featured-images, flexible-width, full-width-template, left-sidebar, post-formats, right-
sidebar, sticky-post, theme-options, threaded-comments, translation-ready
• Requires at least: 3.5
• Tested up to: 3.6
DESCRIPTION
• Oenology is designed to be a simple, minimalist, yet feature-complete and fully documented
Theme intended to serve as a base for child Themes and as an educational reference for
Theme development using WordPress functions, action/filter hooks, and template tags.
Oenology includes built-in breadcrumb navigation, and supports the Theme Customizer,
Contextual Help, Post Formats, Navigation Menus, Post Thumbnails, Custom Backgrounds,
Custom Image Headers, and Custom Editor Style. Oenology features a responsive design, and
includes plug-and-play support for the WP-Paginate and Yoast Breadcrumbs plugins.
• <strong>Requires WordPress 3.5, and is compatible up to WordPress 3.6.</strong>
== DESCRIPTION ==
• Oenology is the study of all aspects of wine-making. Much like wine-making, WordPress Theme
development is both a science and an art.
• Much like wine-making, WordPress Theme development is the result of a fermentation process
that transforms something simple into something beautiful and complex. Much like wine-
making, WordPress Theme development involves an understanding of both the "indoor" (the
back-end data management) and the "outdoor" (website design) elements of the process. Much
like a fine wine, a great WordPress Theme is often the result of years of study by a passionate
developer.
• Oenology doesn't purport to be a fine wine or even a great WordPress Theme. Rather,
Oenology is designed to help others learn the art and science of WordPress Theme
development.
• Consider Oenology as the fertile soil from which your own enjoyment and passion for
WordPress Theme development can grow.
• You, too, can become an Oenologist!
== INSTALLATION ==
• Manual installation:
1. Upload the „oenology‟ folder to the „/wp-content/themes/‟ directory
• Installation using “Add New Theme”
1. From your Admin UI (Dashboard), use the menu to select Themes -> Add New
2. Search for „oenology‟
3. Click the „Install‟ button to open the theme's repository listing
4. Click the „Install‟ button
• Activiation and Use
1. Activate the Theme through the „Themes‟ menu in WordPress
2. See Appearance -> Oenology Options for Theme Options
== FREQUENTLY ASKED QUESTIONS ==
• = So, how do I learn from Oenology? =
• Each Theme template file includes a considerable amount of inline documentation,
explaining the code use. Also, the Theme includes a function reference, that lists
each function, hook, and tag used in the Theme, along with a WordPress Codex
reference, an explanation of the function, and example usage.
• = What is the Oenology Reference admin page? =
• The Oenology Reference admin page contains the latest updates to general Theme
notes, the FAQ, Changelog, License, and, perhaps most importantly, the Code
Reference.
• The Code Reference tab of the Oenology Reference page now replaces the
"oenology-reference.txt" file, as the master cross-reference file, that contains all of
the functions, template tags, and hooks used in the Theme
== FREQUENTLY ASKED QUESTIONS ==
• = What happened to oenology-reference.txt? =
• oenology-reference.txt has been replaced by the "Code Reference" Tab of the "Oenology Reference"
admin page. See Dashboard -> Appearance -> Oenology Reference -> Code Reference.
• = Why so many template files? =
• Oenology is likely broken down into more template parts than the average Theme. This deconstruction
is by design, in order to facilitate easier Child-Theming.
• = What's in store for the future? =
• First and foremost, since Oenology is intended to be a learning tool, the inline and reference
documentation will be a continual work-in-progress, based upon user feedback. This documentation is
complete as of Oenology Version 1.0, but will continue to be updated and improved.
• Other features that may be added in the future:
• - Others, as determined by user feedback and demand
• = What About SEO? =
• I am a firm believer that the single, most important criterion for SEO is good content. That said, the Theme does take apply
some SEO considerations:
1. The Theme assumes that the H1 heading tag will only be applied to the Post Title, and not to any post-entry
content. Accordingly, if you use an H1 heading in the post-entry content, you'll find that it is styled rather similarly to
the H2 heading tag.
2. The Theme template files ensure that the most important content - the post-entry content - is rendered as early as
possible. The loop.php template file is called first, and the sidebar-left.php and sidebar-right.php files are called
second.
3. The Theme supplies a default breadcrumb navigation function.
4. The Theme includes plug-and-play support for the following plugins: WP-Paginate, Yoast Breadcrumbs
• Most of the rest is really up to the user. The Theme is intended to be SEO-neutral: neither hurting your SEO, nor going out of
its way (and adding considerable bloat that is better added via the many good plugins available) to improve it.
== SCREENSHOTS ==
• 1. Standard Theme Screenshot
== CHANGELOG ==
• Note: see the "Oenology Reference" admin page for full Changelog details. See Dashboard -
> Appearance -> Oenology Reference -> Changelog.
• = 3.2 [2013.04.09] =* Maintenance Release
• = 3.1 [2013.03.02] =* Maintenance Release
• = 3.0 [2012.12.22] =* Maintenance Release
• = 2.6 [2012.06.14] =* Maintenance Release
• = 2.5 [2011.12.16] =* Maintenance Release
• = 2.4 [2011.10.06] =* Maintenance Release
• = 2.3 [2011.08.12] =* Maintenance Release
• = 2.2 [2011.07.25] =* Maintenance Release
• = 2.1 [2011.06.21] =* Maintenance Release
== CHANGELOG ==
• = 2.0.3 [2011.06.11] =* Minor Bugfix Release
• = 2.0.2 [2011.06.10] =* Minor Bugfix Release
• = 2.0.1 [2011.06.09] =* Minor Bugfix Release
• = 2.0 [2011.06.09] =* Major Update Release
• = 1.2.2 [2011.05.16] =* Minor Bugfix Release
• = 1.2.1 [2011.04.25] =* Minor Bugfix Release
• = 1.2 [2011.04.25] = * Update Release
• = 1.1 [2011.02.23] =* Update Release
• = 1.0 [2010.12.08] =* Maintenance Release
• = 0.9.2 [2010.11.04] =* Minor BugFix release
• = 0.9.1 [2010.09.24] =* Initial Release
== UPGRADE NOTICE ==
• = 3.2 =Maintenance release.
• = 3.1 =Maintenance release.
• = 3.0 =Maintenance release.
• = 2.6 =Maintenance release.
• = 2.5 =Maintenance release.
• = 2.4 =Maintenance release. Important note: update may cause Child-Theme breakage.
See change log.
• = 2.3 =Maintenance release
• = 2.2 =Maintenance release
• = 2.1 =Maintenance release
== UPGRADE NOTICE ==
• = 2.0.3 =Minor bugfix release
• = 2.0.2 =Minor bugfix release
• = 2.0.1 =Minor bugfix release
• = 2.0 =Major update release
• = 1.2.2 =Minor bugfix release
• = 1.2.1 =Minor bugfix release
• = 1.2 =Update release. Theme Features; Theme options; maintenance; bugfixes;
documentation
• = 1.1 =Update release. Post Formats support; Theme options; bugfixes
• = 1.0 =Maintenance release. Completed inline documentation, added default Widgets, minor
bugfixes, CSS clean-up, minor updates
• = 0.9.2 =Minor BugFix release
• = 0.9.1 =Initial Release.
TRANSLATION FUNCTION
• Never include PHP variables
• $string = sprintf( __('You have %d tacos', 'plugin-domain'), $number );
• Singular plural different strings
• $string = sprintf( _n('You have %d taco.', 'You have %d tacos.', $number, 'plugin-domain'),
$number );
• Order of variables (argument swapping) **DO NOT use double quote
• $string = sprintf( __('You have %1$d tacos and %2$d burritos', 'plugin-domain'),
$taco_count, $burrito_count );
• Disambiguate
• $string = _x( 'Buffalo', 'an animal', 'plugin-domain' );
• $string = _x( 'Buffalo', 'a city in New York', 'plugin-domain' );
• $string = _x( 'Buffalo', 'a verb meaning to confuse somebody', 'plugin-domain' );
APIS
• Plugin API - Hooks, Actions, and Filters to use in your Plugins (version 2.1; has links to
older version articles)
• Shortcode API - A tutorial and reference for the shortcode API (new in version 2.5)
• Dashboard Widgets API - A reference with examples for adding new widgets to the admin
dashboard.
• Settings API - A reference with examples for adding new settings to existing settings
screens.
• Options API - Details about the generic option storage system.
• Transients API - Details about the temporary/time-constrained data storage system.
• Widgets API - A reference with examples for creating widgets for use in sidebars.
• Quicktags API - A reference for adding buttons to the HTML editor.
• Rewrite API - Details about the URL rewriting API.
POSTS
get_adjacent_post get_post is_post (deprecated)
get_boundary_post get_post_ancestors is_single
get_children get_post_mime_type is_sticky
get_extended get_post_status the_ID
get_next_post get_post_format the_date
get_next_posts_link set_post_format wp_get_recent_posts
next_posts_link get_edit_post_link
wp_get_single_post
(deprecated)
get_permalink get_delete_post_link has_post_thumbnail
the_permalink get_previous_post has_excerpt
get_the_excerpt get_previous_posts_link has_post_format
the_excerpt previous_posts_link
get_the_post_thumbnail get_posts
CUSTOM POST TYPE
register_post_type get_post_type
is_post_type_archive get_post_types
post_type_archive_title get_post_type_archive_link
add_post_type_support get_post_type_object
remove_post_type_support get_post_type_capabilities
post_type_supports get_post_type_labels
set_post_type is_post_type_hierarchical
post_type_exists
POST INSERTION AND PAGES
Post insertion/removal Pages Pages
wp_delete_post get_all_page_ids get_page_uri
wp_insert_post get_ancestors get_pages
wp_publish_post get_page is_page
wp_trash_post get_page_link
page_uri_index (method
of class WP_Rewrite)
wp_update_post get_page_by_path wp_link_pages
get_page_by_title wp_list_pages
get_page_children wp_page_menu
get_page_hierarchy wp_dropdown_pages
CUSTOM FIELDS
Custom Fields (postmeta)
add_post_meta
delete_post_meta
get_post_custom
get_post_custom_keys
get_post_custom_values
get_post_meta
update_post_meta
ATTACHMENTS
Attachments
get_attached_file wp_insert_attachment wp_get_attachment_url
image_resize (deprecated) wp_delete_attachment wp_check_for_changed_slugs
image_edit_before_change (ported
to WP_Image_Editor object) wp_get_attachment_image wp_count_posts
is_attachment wp_get_attachment_link wp_get_mime_types
is_local_attachment wp_get_attachment_image_src wp_mime_type_icon
update_attached_file wp_get_attachment_metadata
wp_generate_attachment_metadat
a
wp_attachment_is_image wp_get_attachment_thumb_file wp_prepare_attachment_for_js
wp_create_thumbnail (deprecated) wp_get_attachment_thumb_url wp_update_attachment_metadata
BOOKMARKS, TERMS, OTHERS
Bookmarks Terms Others Others
get_bookmark wp_get_post_categories add_meta_box the_content
get_bookmarks wp_set_post_categories remove_meta_box get_the_title
wp_list_bookmarks wp_get_post_tags get_the_ID the_title
wp_set_post_tags the_ID the_title_attribute
wp_get_post_terms get_the_author register_post_status
wp_set_post_terms the_author wp_trim_excerpt
wp_count_terms get_the_author_posts wp_is_post_revision
has_term get_the_content paginate_links
CATEGORY, TAG AND TAXONOMY FUNCTIONS
Categories
cat_is_ancestor_of get_category_by_path single_cat_title
get_all_category_ids get_category_by_slug in_category
get_ancestors get_the_category_by_ID is_category
get_cat_ID get_the_category_list the_category
get_cat_name get_category_link wp_category_checklist
get_categories get_category_parents wp_list_categories
get_category get_the_category
Category Creation Tags
wp_create_category get_tag is_tag
wp_delete_category get_tag_link the_tags
wp_insert_category get_tags single_tag_title
get_the_tag_list tag_description
get_the_tags
Taxonomy
get_taxonomies get_terms wp_get_object_terms
get_term is_taxonomy (deprecated) wp_set_object_terms
get_the_term_list is_taxonomy_hierarchical wp_insert_term
get_term_by is_term (deprecated) wp_update_term
the_terms taxonomy_exists wp_delete_term
get_the_terms term_exists wp_terms_checklist
get_term_children register_taxonomy
get_term_link register_taxonomy_for_object_type
Admins, Roles and Capabilities
add_cap get_super_admins
add_role is_super_admin
author_can map_meta_cap
current_user_can remove_cap
current_user_can_for_blog remove_role
get_role user_can
Users and Authors
auth_redirect get_profile (deprecated) username_exists
count_users get_user_by validate_username
count_user_posts get_userdata wp_get_current_user
count_many_users_posts
get_usernumposts
(deprecated) wp_set_current_user
email_exists get_users get_author_posts_url
get_currentuserinfo
set_current_user
(deprecated) get_the_modified_author
get_current_user_id user_pass_ok (deprecated) is_multi_author
User meta User insertion/removal
add_user_meta wp_create_user
delete_user_meta wp_delete_user
get_user_meta wp_insert_user
update_user_meta wp_update_user
get_the_author_meta
LOGIN / LOGOUT
is_user_logged_in do_feed_rss get_search_feed_link
wp_login_form do_feed_rss2 get_the_category_rss
wp_signon fetch_feed get_the_title_rss
wp_logout fetch_rss (deprecated)
permalink_single_rss
(deprecated)
Feed Functions get_author_feed_link post_comments_feed_link
bloginfo_rss get_bloginfo_rss rss_enclosure
comment_author_rss get_category_feed_link the_title_rss
comment_link get_comment_link the_category_rss
comment_text_rss get_comment_author_rss the_content_rss (deprecated)
do_feed get_post_comments_feed_link the_excerpt_rss
do_feed_atom get_rss (deprecated) wp_rss (deprecated)
do_feed_rdf get_search_comments_feed_link
COMMENT, PING, AND TRACKBACK FUNCTIONS
add_ping get_comment_meta update_comment_meta
add_comment_meta get_comments weblog_ping
check_comment wp_list_comments wp_allow_comment
comment_text get_enclosed wp_count_comments
comment_form get_lastcommentmodified wp_delete_comment
comments_number get_pung wp_filter_comment
discover_pingback_server_uri get_to_ping wp_get_comment_status
delete_comment_meta have_comments wp_get_current_commenter
do_all_pings get_comment_author wp_insert_comment
do_enclose is_trackback wp_new_comment
do_trackbacks pingback wp_set_comment_status
generic_ping privacy_ping_filter wp_throttle_comment_flood
get_approved_comments sanitize_comment_cookies wp_update_comment
get_avatar trackback wp_update_comment_count
get_comment trackback_url wp_update_comment_count_now
get_comment_text trackback_url_list
Comments Loop Comments Pagination
comment_class paginate_comments_links
comment_ID previous_comments_link
comment_author next_comments_link
comment_date get_comment_pages_count
comment_time
get_comment_date
get_comment_time
ACTIONS, FILTERS AND PLUGIN FUNCTIONS
Filters (Reference) Actions (Reference) Plugins (Reference)
has_filter has_action plugin_basename
add_filter add_action plugins_url
apply_filters do_action get_plugin_data
apply_filters_ref_array do_action_ref_array plugin_dir_path
current_filter did_action register_activation_hook
merge_filters remove_action register_deactivation_hook
remove_filter remove_all_actions menu_page_url
remove_all_filters is_plugin_active
is_plugin_active_for_network
is_plugin_inactive
is_plugin_page
add_contextual_help
get_plugins
ACTIONS, FILTERS AND PLUGIN FUNCTIONS
Widgets (Reference) Settings (Reference) Shortcodes (Reference)
is_active_widget register_setting add_shortcode
register_widget unregister_setting do_shortcode
the_widget settings_fields do_shortcode_tag
unregister_widget do_settings_fields get_shortcode_regex
wp_add_dashboard_widget do_settings_sections remove_shortcode
wp_convert_widget_settings add_settings_field remove_all_shortcodes
wp_get_sidebars_widgets add_settings_section shortcode_atts
wp_get_widget_defaults add_settings_error shortcode_parse_atts
wp_register_sidebar_widget get_settings_errors strip_shortcodes
wp_register_widget_control settings_errors shortcode_exists
wp_set_sidebars_widgets has_shortcode
wp_unregister_sidebar_widget wp_audio_shortcode
wp_unregister_widget_control wp_video_shortcode
wp_widget_description no_texturize_shortcodes
THEME RELATED FUNCTIONS
Pay attention to these!
add_custom_background
(deprecated) get_category_template get_search_template
add_custom_image_header
(deprecated)
get_comments_popup_templat
e get_single_template
add_image_size get_current_theme get_stylesheet
add_theme_support get_date_template get_stylesheet_directory
body_class get_header_image get_stylesheet_directory_uri
current_theme_supports get_header_textcolor get_stylesheet_uri
dynamic_sidebar get_home_template get_tag_template
get_404_template get_locale_stylesheet_uri get_taxonomy_template
get_archive_template get_page_template get_template
get_attachment_template get_paged_template get_template_directory
get_author_template get_post_class get_template_directory_uri
get_body_class get_query_template get_template_part
get_theme (deprecated) in_the_loop
preview_theme_ob_filter_callb
ack
wp_get_themes is_child_theme register_nav_menu
get_theme_data (deprecated) is_active_sidebar register_nav_menus
get_theme_support is_admin_bar_showing get_registered_nav_menus
get_theme_mod is_dynamic_sidebar register_sidebar
get_theme_mods language_attributes register_sidebars
get_theme_root load_template register_theme_directory
get_theme_roots locale_stylesheet remove_theme_mod
get_theme_root_uri locate_template remove_theme_mods
get_themes (deprecated) post_class remove_theme_support
header_image preview_theme require_if_theme_supports
header_textcolor preview_theme_ob_filter search_theme_directories
set_theme_mod wp_page_menu convert_chars
switch_theme wp_title convert_smilies
validate_current_theme Formatting Functions ent2ncr
unregister_nav_menu absint esc_attr
unregister_sidebar add_magic_quotes esc_html
wp_add_inline_style addslashes_gpc esc_js
wp_clean_themes_cache antispambot esc_textarea
wp_get_archives attribute_escape (deprecated) esc_sql
wp_get_nav_menu_items backslashit esc_url
wp_get_theme balanceTags esc_url_raw
wp_nav_menu clean_pre force_balance_tags
wp_oembed_remove_provider clean_url format_to_edit
format_to_post sanitize_mime_type urlencode_deep
funky_javascript_fix
(deprecated) sanitize_option url_shorten
htmlentities2 sanitize_sql_orderby utf8_uri_encode
is_email sanitize_text_field wpautop
js_escape (deprecated) sanitize_title wptexturize
make_clickable sanitize_title_for_query wp_filter_kses
popuplinks sanitize_title_with_dashes wp_filter_post_kses
remove_accents sanitize_user wp_filter_nohtml_kses
sanitize_email seems_utf8 wp_iso_descrambler
sanitize_file_name stripslashes_deep wp_kses
sanitize_html_class trailingslashit wp_kses_array_lc
sanitize_key untrailingslashit wp_kses_attr
wp_kses_bad_protocol wp_kses_split
wp_kses_bad_protocol_once wp_kses_split2
wp_kses_bad_protocol_once2 wp_kses_stripslashes
wp_kses_check_attr_val wp_kses_version
wp_kses_decode_entities wp_make_link_relative
wp_kses_hair wp_rel_nofollow
wp_kses_hook wp_richedit_pre
wp_kses_html_error wp_specialchars
wp_kses_js_entities wp_trim_words
wp_kses_no_null zeroise
wp_kses_normalize_entities
wp_kses_normalize_entities2
Include functions
comments_template
get_footer
get_header
get_sidebar
get_search_form
MISCELLANEOUS FUNCTIONS
Time/Date Functions
current_time get_the_time
date_i18n the_modified_time
get_calendar get_the_modified_time
get_date_from_gmt get_weekstartend
get_lastpostdate get_year_link
get_lastpostmodified human_time_diff
get_day_link is_new_day
get_gmt_from_date iso8601_timezone_to_offset
get_month_link iso8601_to_datetime
the_time mysql2date
MISCELLANEOUS FUNCTIONS
Serialization Options Transients
is_serialized add_option set_transient()
is_serialized_string delete_option get_transient()
maybe_serialize form_option delete_transient()
maybe_unserialize get_alloptions (deprecated) set_site_transient()
get_site_option get_site_transient()
get_site_url delete_site_transient()
get_user_option
get_option
update_option
update_user_option
MISCELLANEOUS FUNCTIONS
Admin Menu Functions
add_menu_page add_management_page
remove_menu_page add_media_page
add_submenu_page add_options_page
remove_submenu_page add_pages_page
add_object_page add_plugins_page
add_utility_page add_posts_page
add_comments_page add_theme_page
add_dashboard_page add_users_page
add_links_page
MISCELLANEOUS FUNCTIONS
Toolbar Functions Form Helpers
add_node checked
remove_node disabled
add_group selected
get_node submit_button
get_nodes get_submit_button
MISCELLANEOUS FUNCTIONS
Nonces and Referers (Security) XMLRPC
check_admin_referer wp_nonce_url xmlrpc_getpostcategory
check_ajax_referer wp_original_referer_field xmlrpc_getposttitle
wp_create_nonce wp_referer_field xmlrpc_removepostdata
wp_explain_nonce
(deprecated) wp_send_json user_pass_ok (deprecated)
wp_get_original_referer wp_send_json_error
wp_get_referer wp_send_json_success
wp_nonce_ays wp_verify_nonce
wp_nonce_field
MISCELLANEOUS FUNCTIONS
Localization Cron (Scheduling)
__ esc_attr_e spawn_cron
_x get_locale wp_clear_scheduled_hook
_n load_default_textdomain wp_cron
_nx load_plugin_textdomain wp_get_schedule
_e load_textdomain wp_get_schedules
_ex load_theme_textdomain wp_next_scheduled
_ngettext (deprecated) is_rtl wp_reschedule_event
esc_attr__ wp_schedule_event
wp_schedule_single_event
wp_unschedule_event
MISCELLANEOUS FUNCTIONS
Conditional Tags Index
comments_open is_date is_single
has_nav_menu is_day is_singular
has_tag is_feed is_sticky
in_category is_front_page is_tag
is_404 is_home is_tax
is_admin is_month is_time
is_archive is_page is_trackback
is_attachment is_page_template is_year
is_author is_paged pings_open
is_category is_preview
is_comments_popup is_search
MISCELLANEOUS FUNCTIONS
Script and Style Registration sql
wp_dequeue_script wp_localize_script get_tax_sql
wp_dequeue_style wp_register_script get_meta_sql
wp_deregister_script wp_register_style get_posts_by_author_sql
wp_deregister_style wp_script_is
wp_enqueue_script wp_style_is
wp_enqueue_style
MISCELLANEOUS
add_editor_style get_num_queries log_app
add_query_arg get_post_stati
make_url_footnote
(deprecated)
add_rewrite_rule get_post_statuses network_admin_url
admin_url get_query_var network_home_url
bool_from_yn home_url network_site_url
cache_javascript_headers includes_url nocache_headers
capital_P_dangit is_blog_installed plugin_dir_url
clean_blog_cache is_main_site query_posts
content_url is_main_query remove_query_arg
do_robots is_multisite rewind_posts
flush_rewrite_rules is_ssl setup_postdata
get_bloginfo is_wp_error site_url
MISCELLANEOUS
status_header wp_hash wp_redirect
wp wp_handle_sideload wp_reset_postdata
wp_cache_set wp_head wp_reset_query
wp_cache_get wp_install_defaults wp_salt
wp_cache_reset (deprecated) wp_is_mobile wp_set_auth_cookie
wp_check_filetype wp_mail wp_safe_redirect
wp_clearcookie (deprecated) wp_mkdir_p wp_upload_bits
wp_die wp_new_user_notification wp_upload_dir
wp_editor
wp_password_change_notifi
cation wp_list_pluck
wp_footer wp_notify_moderator wp_text_diff
wp_get_cookie_login
(deprecated) wp_notify_postauthor post_submit_meta_box
wp_get_image_editor wp_parse_args

Mais conteúdo relacionado

Semelhante a WordPress Theme Development Guide

Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyLeslie Doherty
 
Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his Dutyreedmaniac
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With LoveUp2 Technology
 
Absolute Beginners Guide to Drupal
Absolute Beginners Guide to DrupalAbsolute Beginners Guide to Drupal
Absolute Beginners Guide to DrupalRod Martin
 
Working with Shortcodes in WordPress
Working with Shortcodes in WordPressWorking with Shortcodes in WordPress
Working with Shortcodes in WordPresschaefele
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the BasicsUlrich Krause
 
Plone 5 theming
Plone 5 themingPlone 5 theming
Plone 5 themingsneridagh
 
full-site-editing-theme-presentation.pptx
full-site-editing-theme-presentation.pptxfull-site-editing-theme-presentation.pptx
full-site-editing-theme-presentation.pptxPlasterdog Web Design
 
Experiences with backend user rights in TYPO3
Experiences with backend user rights in TYPO3Experiences with backend user rights in TYPO3
Experiences with backend user rights in TYPO3punkt.de GmbH
 
EECI 2010: Upgrading to EE 2
EECI 2010: Upgrading to EE 2EECI 2010: Upgrading to EE 2
EECI 2010: Upgrading to EE 2ryanirelan
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python courseEran Shlomo
 
Flexible web publishing with Expression Engine
Flexible web publishing with Expression EngineFlexible web publishing with Expression Engine
Flexible web publishing with Expression EngineHarvard Web Working Group
 
Building Responsive Applications Using XPages
Building Responsive Applications Using XPagesBuilding Responsive Applications Using XPages
Building Responsive Applications Using XPagesTeamstudio
 
Developer Night - Opticon18
Developer Night - Opticon18Developer Night - Opticon18
Developer Night - Opticon18Optimizely
 
Frequently asked questions answered frequently - but now for the last time
Frequently asked questions answered frequently - but now for the last timeFrequently asked questions answered frequently - but now for the last time
Frequently asked questions answered frequently - but now for the last timeAndreas Jung
 

Semelhante a WordPress Theme Development Guide (20)

Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his Duty
 
presentation
presentationpresentation
presentation
 
Add-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his DutyAdd-On Development: EE Expects that Every Developer will do his Duty
Add-On Development: EE Expects that Every Developer will do his Duty
 
presentation
presentationpresentation
presentation
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With Love
 
Absolute Beginners Guide to Drupal
Absolute Beginners Guide to DrupalAbsolute Beginners Guide to Drupal
Absolute Beginners Guide to Drupal
 
Working with Shortcodes in WordPress
Working with Shortcodes in WordPressWorking with Shortcodes in WordPress
Working with Shortcodes in WordPress
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the Basics
 
Plone 5 theming
Plone 5 themingPlone 5 theming
Plone 5 theming
 
Plone 5 theming
Plone 5 themingPlone 5 theming
Plone 5 theming
 
WordPress Complete Tutorial
WordPress Complete TutorialWordPress Complete Tutorial
WordPress Complete Tutorial
 
full-site-editing-theme-presentation.pptx
full-site-editing-theme-presentation.pptxfull-site-editing-theme-presentation.pptx
full-site-editing-theme-presentation.pptx
 
Experiences with backend user rights in TYPO3
Experiences with backend user rights in TYPO3Experiences with backend user rights in TYPO3
Experiences with backend user rights in TYPO3
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
EECI 2010: Upgrading to EE 2
EECI 2010: Upgrading to EE 2EECI 2010: Upgrading to EE 2
EECI 2010: Upgrading to EE 2
 
PyCourse - Self driving python course
PyCourse - Self driving python coursePyCourse - Self driving python course
PyCourse - Self driving python course
 
Flexible web publishing with Expression Engine
Flexible web publishing with Expression EngineFlexible web publishing with Expression Engine
Flexible web publishing with Expression Engine
 
Building Responsive Applications Using XPages
Building Responsive Applications Using XPagesBuilding Responsive Applications Using XPages
Building Responsive Applications Using XPages
 
Developer Night - Opticon18
Developer Night - Opticon18Developer Night - Opticon18
Developer Night - Opticon18
 
Frequently asked questions answered frequently - but now for the last time
Frequently asked questions answered frequently - but now for the last timeFrequently asked questions answered frequently - but now for the last time
Frequently asked questions answered frequently - but now for the last time
 

Último

[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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Último (20)

[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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

WordPress Theme Development Guide

  • 1. The Art and Science of WordPress Theme Development Best Practices OENOLOGY
  • 2. === OENOLOGY === • Contributors: Chip Bennett • Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s- xclick&hosted_button_id=QP3N9HUSYJPK6 • Tags: fixed-width, white, black, blue, red, tan, green, one-column, two-columns, three-columns, custom-header, custom- background, custom-menu, editor-style, featured-images, flexible-width, full-width-template, left-sidebar, post-formats, right- sidebar, sticky-post, theme-options, threaded-comments, translation-ready • Requires at least: 3.5 • Tested up to: 3.6
  • 3. DESCRIPTION • Oenology is designed to be a simple, minimalist, yet feature-complete and fully documented Theme intended to serve as a base for child Themes and as an educational reference for Theme development using WordPress functions, action/filter hooks, and template tags. Oenology includes built-in breadcrumb navigation, and supports the Theme Customizer, Contextual Help, Post Formats, Navigation Menus, Post Thumbnails, Custom Backgrounds, Custom Image Headers, and Custom Editor Style. Oenology features a responsive design, and includes plug-and-play support for the WP-Paginate and Yoast Breadcrumbs plugins. • <strong>Requires WordPress 3.5, and is compatible up to WordPress 3.6.</strong>
  • 4. == DESCRIPTION == • Oenology is the study of all aspects of wine-making. Much like wine-making, WordPress Theme development is both a science and an art. • Much like wine-making, WordPress Theme development is the result of a fermentation process that transforms something simple into something beautiful and complex. Much like wine- making, WordPress Theme development involves an understanding of both the "indoor" (the back-end data management) and the "outdoor" (website design) elements of the process. Much like a fine wine, a great WordPress Theme is often the result of years of study by a passionate developer. • Oenology doesn't purport to be a fine wine or even a great WordPress Theme. Rather, Oenology is designed to help others learn the art and science of WordPress Theme development. • Consider Oenology as the fertile soil from which your own enjoyment and passion for WordPress Theme development can grow. • You, too, can become an Oenologist!
  • 5. == INSTALLATION == • Manual installation: 1. Upload the „oenology‟ folder to the „/wp-content/themes/‟ directory • Installation using “Add New Theme” 1. From your Admin UI (Dashboard), use the menu to select Themes -> Add New 2. Search for „oenology‟ 3. Click the „Install‟ button to open the theme's repository listing 4. Click the „Install‟ button • Activiation and Use 1. Activate the Theme through the „Themes‟ menu in WordPress 2. See Appearance -> Oenology Options for Theme Options
  • 6. == FREQUENTLY ASKED QUESTIONS == • = So, how do I learn from Oenology? = • Each Theme template file includes a considerable amount of inline documentation, explaining the code use. Also, the Theme includes a function reference, that lists each function, hook, and tag used in the Theme, along with a WordPress Codex reference, an explanation of the function, and example usage. • = What is the Oenology Reference admin page? = • The Oenology Reference admin page contains the latest updates to general Theme notes, the FAQ, Changelog, License, and, perhaps most importantly, the Code Reference. • The Code Reference tab of the Oenology Reference page now replaces the "oenology-reference.txt" file, as the master cross-reference file, that contains all of the functions, template tags, and hooks used in the Theme
  • 7. == FREQUENTLY ASKED QUESTIONS == • = What happened to oenology-reference.txt? = • oenology-reference.txt has been replaced by the "Code Reference" Tab of the "Oenology Reference" admin page. See Dashboard -> Appearance -> Oenology Reference -> Code Reference. • = Why so many template files? = • Oenology is likely broken down into more template parts than the average Theme. This deconstruction is by design, in order to facilitate easier Child-Theming. • = What's in store for the future? = • First and foremost, since Oenology is intended to be a learning tool, the inline and reference documentation will be a continual work-in-progress, based upon user feedback. This documentation is complete as of Oenology Version 1.0, but will continue to be updated and improved. • Other features that may be added in the future: • - Others, as determined by user feedback and demand
  • 8. • = What About SEO? = • I am a firm believer that the single, most important criterion for SEO is good content. That said, the Theme does take apply some SEO considerations: 1. The Theme assumes that the H1 heading tag will only be applied to the Post Title, and not to any post-entry content. Accordingly, if you use an H1 heading in the post-entry content, you'll find that it is styled rather similarly to the H2 heading tag. 2. The Theme template files ensure that the most important content - the post-entry content - is rendered as early as possible. The loop.php template file is called first, and the sidebar-left.php and sidebar-right.php files are called second. 3. The Theme supplies a default breadcrumb navigation function. 4. The Theme includes plug-and-play support for the following plugins: WP-Paginate, Yoast Breadcrumbs • Most of the rest is really up to the user. The Theme is intended to be SEO-neutral: neither hurting your SEO, nor going out of its way (and adding considerable bloat that is better added via the many good plugins available) to improve it.
  • 9. == SCREENSHOTS == • 1. Standard Theme Screenshot
  • 10. == CHANGELOG == • Note: see the "Oenology Reference" admin page for full Changelog details. See Dashboard - > Appearance -> Oenology Reference -> Changelog. • = 3.2 [2013.04.09] =* Maintenance Release • = 3.1 [2013.03.02] =* Maintenance Release • = 3.0 [2012.12.22] =* Maintenance Release • = 2.6 [2012.06.14] =* Maintenance Release • = 2.5 [2011.12.16] =* Maintenance Release • = 2.4 [2011.10.06] =* Maintenance Release • = 2.3 [2011.08.12] =* Maintenance Release • = 2.2 [2011.07.25] =* Maintenance Release • = 2.1 [2011.06.21] =* Maintenance Release
  • 11. == CHANGELOG == • = 2.0.3 [2011.06.11] =* Minor Bugfix Release • = 2.0.2 [2011.06.10] =* Minor Bugfix Release • = 2.0.1 [2011.06.09] =* Minor Bugfix Release • = 2.0 [2011.06.09] =* Major Update Release • = 1.2.2 [2011.05.16] =* Minor Bugfix Release • = 1.2.1 [2011.04.25] =* Minor Bugfix Release • = 1.2 [2011.04.25] = * Update Release • = 1.1 [2011.02.23] =* Update Release • = 1.0 [2010.12.08] =* Maintenance Release • = 0.9.2 [2010.11.04] =* Minor BugFix release • = 0.9.1 [2010.09.24] =* Initial Release
  • 12. == UPGRADE NOTICE == • = 3.2 =Maintenance release. • = 3.1 =Maintenance release. • = 3.0 =Maintenance release. • = 2.6 =Maintenance release. • = 2.5 =Maintenance release. • = 2.4 =Maintenance release. Important note: update may cause Child-Theme breakage. See change log. • = 2.3 =Maintenance release • = 2.2 =Maintenance release • = 2.1 =Maintenance release
  • 13. == UPGRADE NOTICE == • = 2.0.3 =Minor bugfix release • = 2.0.2 =Minor bugfix release • = 2.0.1 =Minor bugfix release • = 2.0 =Major update release • = 1.2.2 =Minor bugfix release • = 1.2.1 =Minor bugfix release • = 1.2 =Update release. Theme Features; Theme options; maintenance; bugfixes; documentation • = 1.1 =Update release. Post Formats support; Theme options; bugfixes • = 1.0 =Maintenance release. Completed inline documentation, added default Widgets, minor bugfixes, CSS clean-up, minor updates • = 0.9.2 =Minor BugFix release • = 0.9.1 =Initial Release.
  • 14. TRANSLATION FUNCTION • Never include PHP variables • $string = sprintf( __('You have %d tacos', 'plugin-domain'), $number ); • Singular plural different strings • $string = sprintf( _n('You have %d taco.', 'You have %d tacos.', $number, 'plugin-domain'), $number ); • Order of variables (argument swapping) **DO NOT use double quote • $string = sprintf( __('You have %1$d tacos and %2$d burritos', 'plugin-domain'), $taco_count, $burrito_count ); • Disambiguate • $string = _x( 'Buffalo', 'an animal', 'plugin-domain' ); • $string = _x( 'Buffalo', 'a city in New York', 'plugin-domain' ); • $string = _x( 'Buffalo', 'a verb meaning to confuse somebody', 'plugin-domain' );
  • 15. APIS • Plugin API - Hooks, Actions, and Filters to use in your Plugins (version 2.1; has links to older version articles) • Shortcode API - A tutorial and reference for the shortcode API (new in version 2.5) • Dashboard Widgets API - A reference with examples for adding new widgets to the admin dashboard. • Settings API - A reference with examples for adding new settings to existing settings screens. • Options API - Details about the generic option storage system. • Transients API - Details about the temporary/time-constrained data storage system. • Widgets API - A reference with examples for creating widgets for use in sidebars. • Quicktags API - A reference for adding buttons to the HTML editor. • Rewrite API - Details about the URL rewriting API.
  • 16. POSTS get_adjacent_post get_post is_post (deprecated) get_boundary_post get_post_ancestors is_single get_children get_post_mime_type is_sticky get_extended get_post_status the_ID get_next_post get_post_format the_date get_next_posts_link set_post_format wp_get_recent_posts next_posts_link get_edit_post_link wp_get_single_post (deprecated) get_permalink get_delete_post_link has_post_thumbnail the_permalink get_previous_post has_excerpt get_the_excerpt get_previous_posts_link has_post_format the_excerpt previous_posts_link get_the_post_thumbnail get_posts
  • 17. CUSTOM POST TYPE register_post_type get_post_type is_post_type_archive get_post_types post_type_archive_title get_post_type_archive_link add_post_type_support get_post_type_object remove_post_type_support get_post_type_capabilities post_type_supports get_post_type_labels set_post_type is_post_type_hierarchical post_type_exists
  • 18. POST INSERTION AND PAGES Post insertion/removal Pages Pages wp_delete_post get_all_page_ids get_page_uri wp_insert_post get_ancestors get_pages wp_publish_post get_page is_page wp_trash_post get_page_link page_uri_index (method of class WP_Rewrite) wp_update_post get_page_by_path wp_link_pages get_page_by_title wp_list_pages get_page_children wp_page_menu get_page_hierarchy wp_dropdown_pages
  • 19. CUSTOM FIELDS Custom Fields (postmeta) add_post_meta delete_post_meta get_post_custom get_post_custom_keys get_post_custom_values get_post_meta update_post_meta
  • 20. ATTACHMENTS Attachments get_attached_file wp_insert_attachment wp_get_attachment_url image_resize (deprecated) wp_delete_attachment wp_check_for_changed_slugs image_edit_before_change (ported to WP_Image_Editor object) wp_get_attachment_image wp_count_posts is_attachment wp_get_attachment_link wp_get_mime_types is_local_attachment wp_get_attachment_image_src wp_mime_type_icon update_attached_file wp_get_attachment_metadata wp_generate_attachment_metadat a wp_attachment_is_image wp_get_attachment_thumb_file wp_prepare_attachment_for_js wp_create_thumbnail (deprecated) wp_get_attachment_thumb_url wp_update_attachment_metadata
  • 21. BOOKMARKS, TERMS, OTHERS Bookmarks Terms Others Others get_bookmark wp_get_post_categories add_meta_box the_content get_bookmarks wp_set_post_categories remove_meta_box get_the_title wp_list_bookmarks wp_get_post_tags get_the_ID the_title wp_set_post_tags the_ID the_title_attribute wp_get_post_terms get_the_author register_post_status wp_set_post_terms the_author wp_trim_excerpt wp_count_terms get_the_author_posts wp_is_post_revision has_term get_the_content paginate_links
  • 22. CATEGORY, TAG AND TAXONOMY FUNCTIONS Categories cat_is_ancestor_of get_category_by_path single_cat_title get_all_category_ids get_category_by_slug in_category get_ancestors get_the_category_by_ID is_category get_cat_ID get_the_category_list the_category get_cat_name get_category_link wp_category_checklist get_categories get_category_parents wp_list_categories get_category get_the_category
  • 23. Category Creation Tags wp_create_category get_tag is_tag wp_delete_category get_tag_link the_tags wp_insert_category get_tags single_tag_title get_the_tag_list tag_description get_the_tags
  • 24. Taxonomy get_taxonomies get_terms wp_get_object_terms get_term is_taxonomy (deprecated) wp_set_object_terms get_the_term_list is_taxonomy_hierarchical wp_insert_term get_term_by is_term (deprecated) wp_update_term the_terms taxonomy_exists wp_delete_term get_the_terms term_exists wp_terms_checklist get_term_children register_taxonomy get_term_link register_taxonomy_for_object_type
  • 25. Admins, Roles and Capabilities add_cap get_super_admins add_role is_super_admin author_can map_meta_cap current_user_can remove_cap current_user_can_for_blog remove_role get_role user_can
  • 26. Users and Authors auth_redirect get_profile (deprecated) username_exists count_users get_user_by validate_username count_user_posts get_userdata wp_get_current_user count_many_users_posts get_usernumposts (deprecated) wp_set_current_user email_exists get_users get_author_posts_url get_currentuserinfo set_current_user (deprecated) get_the_modified_author get_current_user_id user_pass_ok (deprecated) is_multi_author
  • 27. User meta User insertion/removal add_user_meta wp_create_user delete_user_meta wp_delete_user get_user_meta wp_insert_user update_user_meta wp_update_user get_the_author_meta
  • 28. LOGIN / LOGOUT is_user_logged_in do_feed_rss get_search_feed_link wp_login_form do_feed_rss2 get_the_category_rss wp_signon fetch_feed get_the_title_rss wp_logout fetch_rss (deprecated) permalink_single_rss (deprecated) Feed Functions get_author_feed_link post_comments_feed_link bloginfo_rss get_bloginfo_rss rss_enclosure comment_author_rss get_category_feed_link the_title_rss comment_link get_comment_link the_category_rss comment_text_rss get_comment_author_rss the_content_rss (deprecated) do_feed get_post_comments_feed_link the_excerpt_rss do_feed_atom get_rss (deprecated) wp_rss (deprecated) do_feed_rdf get_search_comments_feed_link
  • 29. COMMENT, PING, AND TRACKBACK FUNCTIONS add_ping get_comment_meta update_comment_meta add_comment_meta get_comments weblog_ping check_comment wp_list_comments wp_allow_comment comment_text get_enclosed wp_count_comments comment_form get_lastcommentmodified wp_delete_comment comments_number get_pung wp_filter_comment discover_pingback_server_uri get_to_ping wp_get_comment_status delete_comment_meta have_comments wp_get_current_commenter do_all_pings get_comment_author wp_insert_comment do_enclose is_trackback wp_new_comment do_trackbacks pingback wp_set_comment_status generic_ping privacy_ping_filter wp_throttle_comment_flood get_approved_comments sanitize_comment_cookies wp_update_comment get_avatar trackback wp_update_comment_count get_comment trackback_url wp_update_comment_count_now get_comment_text trackback_url_list
  • 30. Comments Loop Comments Pagination comment_class paginate_comments_links comment_ID previous_comments_link comment_author next_comments_link comment_date get_comment_pages_count comment_time get_comment_date get_comment_time
  • 31. ACTIONS, FILTERS AND PLUGIN FUNCTIONS Filters (Reference) Actions (Reference) Plugins (Reference) has_filter has_action plugin_basename add_filter add_action plugins_url apply_filters do_action get_plugin_data apply_filters_ref_array do_action_ref_array plugin_dir_path current_filter did_action register_activation_hook merge_filters remove_action register_deactivation_hook remove_filter remove_all_actions menu_page_url remove_all_filters is_plugin_active is_plugin_active_for_network is_plugin_inactive is_plugin_page add_contextual_help get_plugins
  • 32. ACTIONS, FILTERS AND PLUGIN FUNCTIONS Widgets (Reference) Settings (Reference) Shortcodes (Reference) is_active_widget register_setting add_shortcode register_widget unregister_setting do_shortcode the_widget settings_fields do_shortcode_tag unregister_widget do_settings_fields get_shortcode_regex wp_add_dashboard_widget do_settings_sections remove_shortcode wp_convert_widget_settings add_settings_field remove_all_shortcodes wp_get_sidebars_widgets add_settings_section shortcode_atts wp_get_widget_defaults add_settings_error shortcode_parse_atts wp_register_sidebar_widget get_settings_errors strip_shortcodes wp_register_widget_control settings_errors shortcode_exists wp_set_sidebars_widgets has_shortcode wp_unregister_sidebar_widget wp_audio_shortcode wp_unregister_widget_control wp_video_shortcode wp_widget_description no_texturize_shortcodes
  • 33. THEME RELATED FUNCTIONS Pay attention to these!
  • 34. add_custom_background (deprecated) get_category_template get_search_template add_custom_image_header (deprecated) get_comments_popup_templat e get_single_template add_image_size get_current_theme get_stylesheet add_theme_support get_date_template get_stylesheet_directory body_class get_header_image get_stylesheet_directory_uri current_theme_supports get_header_textcolor get_stylesheet_uri dynamic_sidebar get_home_template get_tag_template get_404_template get_locale_stylesheet_uri get_taxonomy_template get_archive_template get_page_template get_template get_attachment_template get_paged_template get_template_directory get_author_template get_post_class get_template_directory_uri get_body_class get_query_template get_template_part
  • 35. get_theme (deprecated) in_the_loop preview_theme_ob_filter_callb ack wp_get_themes is_child_theme register_nav_menu get_theme_data (deprecated) is_active_sidebar register_nav_menus get_theme_support is_admin_bar_showing get_registered_nav_menus get_theme_mod is_dynamic_sidebar register_sidebar get_theme_mods language_attributes register_sidebars get_theme_root load_template register_theme_directory get_theme_roots locale_stylesheet remove_theme_mod get_theme_root_uri locate_template remove_theme_mods get_themes (deprecated) post_class remove_theme_support header_image preview_theme require_if_theme_supports header_textcolor preview_theme_ob_filter search_theme_directories
  • 36. set_theme_mod wp_page_menu convert_chars switch_theme wp_title convert_smilies validate_current_theme Formatting Functions ent2ncr unregister_nav_menu absint esc_attr unregister_sidebar add_magic_quotes esc_html wp_add_inline_style addslashes_gpc esc_js wp_clean_themes_cache antispambot esc_textarea wp_get_archives attribute_escape (deprecated) esc_sql wp_get_nav_menu_items backslashit esc_url wp_get_theme balanceTags esc_url_raw wp_nav_menu clean_pre force_balance_tags wp_oembed_remove_provider clean_url format_to_edit
  • 37. format_to_post sanitize_mime_type urlencode_deep funky_javascript_fix (deprecated) sanitize_option url_shorten htmlentities2 sanitize_sql_orderby utf8_uri_encode is_email sanitize_text_field wpautop js_escape (deprecated) sanitize_title wptexturize make_clickable sanitize_title_for_query wp_filter_kses popuplinks sanitize_title_with_dashes wp_filter_post_kses remove_accents sanitize_user wp_filter_nohtml_kses sanitize_email seems_utf8 wp_iso_descrambler sanitize_file_name stripslashes_deep wp_kses sanitize_html_class trailingslashit wp_kses_array_lc sanitize_key untrailingslashit wp_kses_attr
  • 38. wp_kses_bad_protocol wp_kses_split wp_kses_bad_protocol_once wp_kses_split2 wp_kses_bad_protocol_once2 wp_kses_stripslashes wp_kses_check_attr_val wp_kses_version wp_kses_decode_entities wp_make_link_relative wp_kses_hair wp_rel_nofollow wp_kses_hook wp_richedit_pre wp_kses_html_error wp_specialchars wp_kses_js_entities wp_trim_words wp_kses_no_null zeroise wp_kses_normalize_entities wp_kses_normalize_entities2 Include functions comments_template get_footer get_header get_sidebar get_search_form
  • 39. MISCELLANEOUS FUNCTIONS Time/Date Functions current_time get_the_time date_i18n the_modified_time get_calendar get_the_modified_time get_date_from_gmt get_weekstartend get_lastpostdate get_year_link get_lastpostmodified human_time_diff get_day_link is_new_day get_gmt_from_date iso8601_timezone_to_offset get_month_link iso8601_to_datetime the_time mysql2date
  • 40. MISCELLANEOUS FUNCTIONS Serialization Options Transients is_serialized add_option set_transient() is_serialized_string delete_option get_transient() maybe_serialize form_option delete_transient() maybe_unserialize get_alloptions (deprecated) set_site_transient() get_site_option get_site_transient() get_site_url delete_site_transient() get_user_option get_option update_option update_user_option
  • 41. MISCELLANEOUS FUNCTIONS Admin Menu Functions add_menu_page add_management_page remove_menu_page add_media_page add_submenu_page add_options_page remove_submenu_page add_pages_page add_object_page add_plugins_page add_utility_page add_posts_page add_comments_page add_theme_page add_dashboard_page add_users_page add_links_page
  • 42. MISCELLANEOUS FUNCTIONS Toolbar Functions Form Helpers add_node checked remove_node disabled add_group selected get_node submit_button get_nodes get_submit_button
  • 43. MISCELLANEOUS FUNCTIONS Nonces and Referers (Security) XMLRPC check_admin_referer wp_nonce_url xmlrpc_getpostcategory check_ajax_referer wp_original_referer_field xmlrpc_getposttitle wp_create_nonce wp_referer_field xmlrpc_removepostdata wp_explain_nonce (deprecated) wp_send_json user_pass_ok (deprecated) wp_get_original_referer wp_send_json_error wp_get_referer wp_send_json_success wp_nonce_ays wp_verify_nonce wp_nonce_field
  • 44. MISCELLANEOUS FUNCTIONS Localization Cron (Scheduling) __ esc_attr_e spawn_cron _x get_locale wp_clear_scheduled_hook _n load_default_textdomain wp_cron _nx load_plugin_textdomain wp_get_schedule _e load_textdomain wp_get_schedules _ex load_theme_textdomain wp_next_scheduled _ngettext (deprecated) is_rtl wp_reschedule_event esc_attr__ wp_schedule_event wp_schedule_single_event wp_unschedule_event
  • 45. MISCELLANEOUS FUNCTIONS Conditional Tags Index comments_open is_date is_single has_nav_menu is_day is_singular has_tag is_feed is_sticky in_category is_front_page is_tag is_404 is_home is_tax is_admin is_month is_time is_archive is_page is_trackback is_attachment is_page_template is_year is_author is_paged pings_open is_category is_preview is_comments_popup is_search
  • 46. MISCELLANEOUS FUNCTIONS Script and Style Registration sql wp_dequeue_script wp_localize_script get_tax_sql wp_dequeue_style wp_register_script get_meta_sql wp_deregister_script wp_register_style get_posts_by_author_sql wp_deregister_style wp_script_is wp_enqueue_script wp_style_is wp_enqueue_style
  • 47. MISCELLANEOUS add_editor_style get_num_queries log_app add_query_arg get_post_stati make_url_footnote (deprecated) add_rewrite_rule get_post_statuses network_admin_url admin_url get_query_var network_home_url bool_from_yn home_url network_site_url cache_javascript_headers includes_url nocache_headers capital_P_dangit is_blog_installed plugin_dir_url clean_blog_cache is_main_site query_posts content_url is_main_query remove_query_arg do_robots is_multisite rewind_posts flush_rewrite_rules is_ssl setup_postdata get_bloginfo is_wp_error site_url
  • 48. MISCELLANEOUS status_header wp_hash wp_redirect wp wp_handle_sideload wp_reset_postdata wp_cache_set wp_head wp_reset_query wp_cache_get wp_install_defaults wp_salt wp_cache_reset (deprecated) wp_is_mobile wp_set_auth_cookie wp_check_filetype wp_mail wp_safe_redirect wp_clearcookie (deprecated) wp_mkdir_p wp_upload_bits wp_die wp_new_user_notification wp_upload_dir wp_editor wp_password_change_notifi cation wp_list_pluck wp_footer wp_notify_moderator wp_text_diff wp_get_cookie_login (deprecated) wp_notify_postauthor post_submit_meta_box wp_get_image_editor wp_parse_args