• Like
  • Save
Theme Development from the Coding End
Upcoming SlideShare
Loading in...5
×
 

Theme Development from the Coding End

on

  • 4,458 views

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

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

Statistics

Views

Total Views
4,458
Views on SlideShare
4,194
Embed Views
264

Actions

Likes
5
Downloads
0
Comments
0

6 Embeds 264

http://www.wordpressasylum.com 239
http://eastbaywp.com 13
http://wordpressasylum.com 8
http://webcache.googleusercontent.com 2
http://www.slideshare.net 1
http://translate.googleusercontent.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />
  • <br />

Theme Development from the Coding End Theme Development from the Coding End Presentation Transcript

  • WordPress Theming Custom Pages, Custom Post Types, & Custom Fields Lori Berkowitz http://beedragon.com
  • Overview • The Codex ♥ • Template Tags/ Template Hierarchy • The Loop • Custom Loops / Multiple Loops • Custom Fields • Custom Post Types
  • WordPress Codex • http://codex.wordpress.org • /Template_Tags • /Conditional_Tags • /Include_tags • /Function_Reference
  • 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 )
  • 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
  • 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
  • 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"
  • Conditional Tag with a Parameter Add CSS class to posts in Category 3 only:
  • Example Post Code
  • 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
  • The Loop The Loop displays WordPress posts.
  • 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.
  • Pets Page
  • Multiple Loops: wp_query(); <!-- Start the default loop -->
  • Custom Fields
  • dob Display the custom fields dob
  • Custom Post Type
  • Questions?