Your SlideShare is downloading. ×
Theme Development from the Coding End
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Theme Development from the Coding End

3,959
views

Published on

Lori Berkowitz explains some of the aspects of theme development, inc

Lori Berkowitz explains some of the aspects of theme development, inc

Published in: Technology

0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,959
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
6
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide



















  • Transcript

    • 1. WordPress Theming Custom Pages, Custom Post Types, & Custom Fields Lori Berkowitz http://beedragon.com
    • 2. Overview • The Codex ♥ • Template Tags/ Template Hierarchy • The Loop • Custom Loops / Multiple Loops • Custom Fields • Custom Post Types
    • 3. WordPress Codex • http://codex.wordpress.org • /Template_Tags • /Conditional_Tags • /Include_tags • /Function_Reference
    • 4. Child Themes • Separate template folder than parent theme • Uses parent theme files unless overridden • Must have a style.css file /* Theme Name: awesome Theme URI: http: //beedragon.com/ Description: awesome child theme for twentyten Author: Lori B Author URI: http: //lbnuke.com/ Template: twentyten Version: 1.0 */ @import url('../twentyten/style.css'); /* import parent styles */ Parent themes: twentyten, Thematic, Hybrid, Genesis*, Thesis* ( * Commercial Theme )
    • 5. Include Tags Work like PHP include() statements • <?php get_header(); ?> Includes header.php • <?php get_sidebar(); ?> Includes sidebar.php • <?php get_footer(); ?> Includes footer.php • <?php get_search_form() ?> Includes searchform.php • <?php comments_template(); ?> Includes comments.php
    • 6. Conditional Tags • is_home() Main blog page • is_front_page() Front page from Settings > Reading • is_single() Single post page • is_sticky() Returns true if sticky box is checked • is_page() A "page" page • is_category() Category archive page • is_author() Author page • is_404() HTTP 404: Not Found error page
    • 7. Tag Parameters For template tags, conditional tags, include tags, etc. Examples: is_page( '19' ) Page with ID 19 is_page( 'about' ) About page (slug) is_page( 'About Me' ) About page (post title) is_page ( array( 19, 'about', 'Contact Us' ) ) Returns true when displayed page is either post ID 19 OR post_name "about-me" OR post_title "Contact Us"
    • 8. Conditional Tag with a Parameter Add CSS class to posts in Category 3 only:
    • 9. Example Post Code
    • 10. Template Hierarchy Home: Search: 404: • home.php • search.php • 404.php • index.php • index.php • index.php Post: Page: Category: • single- • pagename.php • category-slug.php posttype.php • page-slug.php • category-id.php • single.php • page-id.php • category.php • index.php • page.php • archive.php • index.php • index.php
    • 11. The Loop The Loop displays WordPress posts.
    • 12. query_posts(); Query the WP database for pet posts: Before the Loop: query_posts( 'post_type = pets' ); The query_posts function is intended to be used to modify the main page Loop only.
    • 13. Pets Page
    • 14. Multiple Loops: wp_query(); <!-- Start the default loop -->
    • 15. Custom Fields
    • 16. dob Display the custom fields dob
    • 17. Custom Post Type
    • 18. Questions?

    ×