• Save
Dev Theming
Upcoming SlideShare
Loading in...5
×
 

Dev Theming

on

  • 2,573 views

 

Statistics

Views

Total Views
2,573
Views on SlideShare
2,573
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

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 />

Dev Theming Dev Theming 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 Type
  • 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/awesome Description: awesome child theme for twentyten Author: Lori B Author URI: http: //beedragon.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() Author page • is_author() Category archive 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?