Your SlideShare is downloading. ×
0
Creating Themes
Creating Themes
Creating Themes
Creating Themes
Creating Themes
Creating Themes
Creating Themes
Creating Themes
Creating Themes
Creating Themes
Creating Themes
Creating Themes
Creating Themes
Creating Themes
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

Creating Themes

4,631

Published on

WordPress Theme Basics. Presented by Daisy Olsen at WordCamp NYC on November 14, 2009.

WordPress Theme Basics. Presented by Daisy Olsen at WordCamp NYC on November 14, 2009.

Published in: Technology, Business
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,631
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
66
Comments
0
Likes
4
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. Understanding WordPress Themes Daisy Olsen http://wpmama.com @DaisyOlsen
  • 2. Stylesheet Heading /* Theme Name: Origins Theme Theme URI: http://wpmama.com/origins-theme Description: A blank theme Version: 1.0 Author: Daisy Olsen Author URI: http://wpmama.com/ Template: origins (for use when creating a child theme) Tags: blank, empty, minimal */
  • 3. Importing other Stylesheets @import url(css/reset.css);
  • 4. The Simplest Index.php file <?php get_header(); if (have_posts()) : while (have_posts()) : the_post(); the_content(); endwhile; Endif; get_sidebar(); get_footer(); ?>
  • 5. “ The Loop” <?php if (have_posts()) : while (have_posts()) : the_post(); ?> Stuff to display for each Post <?php endwhile; ?> <?php else : ?> Stuff to display if no posts are returned by the have_posts() function <?php endif; ?>
  • 6. Extending Your Theme
  • 11. Include Tags Used within a Template file to execute code found in another template file
    • get_header(); /* header.php */
    • 12. get_footer(); /* footer.php */
    • 13. get_sidebar(); /* sidebar.php */
    • 14. get_search_form(); /*searchform.php*/
    • 15. comments_template(); /*coments.php */
    • 16. Include( TEMPLATEPATH . '/header2.php');
    • 17. Include( STYLESHEETPATH . '/header2.php');
  • 18. Template Files
  • 31. Template Tags
    • An instruction for WordPress to “do” or “get” something
    • 32. Parameters can be passed in template tags
    • 33. A Basic Template Tag Function
    <?php the_content(); ?>
    • With the $more_link_text parameter set
    <?php the_content('Read more...'); ?>
  • 34. Basic API Hooks
        • Placed inside the <head> element of the theme. Usually in header.php
    • wp_head ();
        • Placed inside the <head> element of the theme. Usually in header.php
    • wp_footer();
        • Place at the bottom of the theme. Usually in footer.php
    • comment_form();
  • 35. Filter Hook – Modify Core Function Behavior
      Filtering the More Link (Thanks to Justin Tadlock)
    add_filter( 'the_content_more_link', 'my_more_link', 10, 2 ); function my_more_link( $more_link, $more_link_text ) { return str_replace( $more_link_text, 'Continue reading &rarr;', $more_link ); }
  • 36. Functions.php
    • Sidebars are Registered in this file
    • 37. Additional code placed here
    • 38. Can extend functionality of a theme to include anything that a plugin can do.
  • 39. Look at a Working Theme
  • 40. Questions? Daisy Olsen wpmama.com @DaisyOlsen

×