Permalink
Browse files

Lesson 1 - Child Theme of Twenty Ten Demo

  • Loading branch information...
0 parents commit 60884ca9165a537e30ff0b97074dec53568aa7a1 @crondeau committed Sep 24, 2011
Showing with 447 additions and 0 deletions.
  1. +19 −0 functions.php
  2. +79 −0 header.php
  3. BIN images/main_bg.gif
  4. +23 −0 loop-page.php
  5. +54 −0 loop-single.php
  6. +30 −0 readme.txt
  7. BIN screenshot.png
  8. +242 −0 style.css
@@ -0,0 +1,19 @@
+<?php
+function twentyten_setup() {
+
+
+ // This theme allows users to set a custom background
+ //add_custom_background();
+
+
+ // Add a way for the custom header to be styled in the admin panel that controls
+ // custom headers. See twentyten_admin_header_style(), below.
+ //add_custom_image_header( '', 'twentyten_admin_header_style' );
+
+ // ... and thus ends the changeable header business.
+
+// Add menu features
+register_nav_menus(array('primary'=>__('Primary Menu'),));
+
+}
+
@@ -0,0 +1,79 @@
+<?php
+/**
+ * The Header for our theme.
+ *
+ * Displays all of the <head> section and everything up till <div id="main">
+ *
+ * @package WordPress
+ * @subpackage Twenty_Ten
+ * @since Twenty Ten 1.0
+ */
+?><!DOCTYPE html>
+<html <?php language_attributes(); ?>>
+<head>
+<meta charset="<?php bloginfo( 'charset' ); ?>" />
+<title><?php
+ /*
+ * Print the <title> tag based on what is being viewed.
+ */
+ global $page, $paged;
+
+ wp_title( '|', true, 'right' );
+
+ // Add the blog name.
+ bloginfo( 'name' );
+
+ // Add the blog description for the home/front page.
+ $site_description = get_bloginfo( 'description', 'display' );
+ if ( $site_description && ( is_home() || is_front_page() ) )
+ echo " | $site_description";
+
+ // Add a page number if necessary:
+ if ( $paged >= 2 || $page >= 2 )
+ echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );
+
+ ?></title>
+<link rel="profile" href="http://gmpg.org/xfn/11" />
+<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
+<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
+<?php
+ /* We add some JavaScript to pages with the comment form
+ * to support sites with threaded comments (when in use).
+ */
+ if ( is_singular() && get_option( 'thread_comments' ) )
+ wp_enqueue_script( 'comment-reply' );
+
+ /* Always have wp_head() just before the closing </head>
+ * tag of your theme, or you will break many plugins, which
+ * generally use this hook to add elements to <head> such
+ * as styles, scripts, and meta tags.
+ */
+ wp_head();
+?>
+</head>
+
+<body <?php body_class(); ?>>
+<div id="wrapper" class="hfeed">
+ <div id="header">
+ <div id="masthead">
+ <div id="branding" role="banner">
+ <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
+ <<?php echo $heading_tag; ?> id="site-title">
+ <span>
+ <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
+ </span>
+ </<?php echo $heading_tag; ?>>
+ <div id="site-description"><?php bloginfo( 'description' ); ?></div>
+
+ </div><!-- #branding -->
+
+ <div id="access" role="navigation">
+ <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
+ <div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>
+ <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?>
+ <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
+ </div><!-- #access -->
+ </div><!-- #masthead -->
+ </div><!-- #header -->
+
+ <div id="main">
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,23 @@
+<?php
+/**
+ * We're removed the comment option on the page.
+ */
+?>
+
+<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
+
+ <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <?php if ( is_front_page() ) { ?>
+ <h2 class="entry-title"><?php the_title(); ?></h2>
+ <?php } else { ?>
+ <h1 class="entry-title"><?php the_title(); ?></h1>
+ <?php } ?>
+
+ <div class="entry-content">
+ <?php the_content(); ?>
+ <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
+ <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
+ </div><!-- .entry-content -->
+ </div><!-- #post-## -->
+
+<?php endwhile; // end of the loop. ?>
@@ -0,0 +1,54 @@
+<?php
+/**
+ * The loop that displays a single post.
+ * This is a modified version of the twentyten single file. I 've removed the previous and next link at the top.
+ */
+?>
+
+<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
+
+
+
+ <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+ <h1 class="entry-title"><?php the_title(); ?></h1>
+
+ <div class="entry-meta">
+ <?php twentyten_posted_on(); ?>
+ </div><!-- .entry-meta -->
+
+ <div class="entry-content">
+ <?php the_content(); ?>
+ <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
+ </div><!-- .entry-content -->
+
+<?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?>
+ <div id="entry-author-info">
+ <div id="author-avatar">
+ <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
+ </div><!-- #author-avatar -->
+ <div id="author-description">
+ <h2><?php printf( esc_attr__( 'About %s', 'twentyten' ), get_the_author() ); ?></h2>
+ <?php the_author_meta( 'description' ); ?>
+ <div id="author-link">
+ <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
+ <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentyten' ), get_the_author() ); ?>
+ </a>
+ </div><!-- #author-link -->
+ </div><!-- #author-description -->
+ </div><!-- #entry-author-info -->
+<?php endif; ?>
+
+ <div class="entry-utility">
+ <?php twentyten_posted_in(); ?>
+ <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
+ </div><!-- .entry-utility -->
+ </div><!-- #post-## -->
+
+ <div id="nav-below" class="navigation">
+ <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
+ <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
+ </div><!-- #nav-below -->
+
+ <?php comments_template( '', true ); ?>
+
+<?php endwhile; // end of the loop. ?>
@@ -0,0 +1,30 @@
+WP Yogi 2010 Child theme
+
+This theme was created as part of a tutorial provided at WPyogi.com.
+
+http://www.wpyogi.com/2011/04/step-by-step-guide-to-making-a-twentyten-child-theme/
+
+
+You can check out a demo of the theme here.
+http://twentyten.wpyogi.com/
+
+
+
+----------
+INSTALLATION
+
+To install upload wpyogi-2010child to your /wp-content/themes directory.
+Import the xml file provided
+
+----------
+License
+
+This theme is provided for educational purposes only.
+You are free to modify it in any way you want.
+Please do not distribute the theme as is as your own.
+
+
+--Christine Rondeau
+Bluelimemedia.com
+WPyogi.com
+
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit 60884ca

Please sign in to comment.