Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Lesson 1 - Child Theme of Twenty Ten Demo

  • Loading branch information...
commit 60884ca9165a537e30ff0b97074dec53568aa7a1 0 parents
@crondeau authored
19 functions.php
@@ -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'),));
+
+}
+
79 header.php
@@ -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">
BIN  images/main_bg.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 loop-page.php
@@ -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. ?>
54 loop-single.php
@@ -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. ?>
30 readme.txt
@@ -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
+
BIN  screenshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
242 style.css
@@ -0,0 +1,242 @@
+/*
+Theme Name: Child of Twenty Ten
+Theme URI: http://www.crondeau.com/emd
+Description: Child Theme for Demo Purposes
+Author: Christine Rondeau
+Author URI: http://crondeau.com
+Template: twentyten
+Version: 0.1
+*/
+
+@import url("../twentyten/style.css");
+
+body,
+input,
+textarea {
+ color: #000;
+}
+
+a:link {
+ color:#f71c9d;
+}
+a:visited {
+ color:#f71c9d;
+}
+a:active,
+a:hover {
+ color: #fb8fcf;
+}
+
+
+
+body {
+ background: #FFF;
+ font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
+}
+
+#wrapper {
+ margin: 0 auto; padding: 0;
+ width: 960px;
+
+
+}
+/* Styles for header area
+-----------------------------------*/
+#header {
+ padding: 0;
+ border-top:5px solid #000;
+}
+#branding {padding: 20px 0;}
+
+#site-title a {
+ color: #000;
+ font-weight:normal;
+}
+
+
+/* =Menu
+-------------------------------------------------------------- */
+
+#access {
+ background: #000;
+ display: block;
+ float: left;
+ margin: 0 auto;
+ width: 960px;
+}
+#access .menu-header,
+div.menu {
+ font-size: 13px;
+ text-transform:uppercase;
+ margin: 0px;
+}
+#access a {
+ color: #fff;
+ line-height: 32px;
+ border-top:3px solid #000;
+}
+#access ul ul {top: 32px;}
+#access ul ul li {min-width: 180px;}
+#access ul ul ul {
+ left: 100%;
+ top: 0;
+}
+#access ul li ul li a {
+ background: #000;
+ line-height: 1em;
+ padding: 10px;
+ width: 160px;
+ height: auto;
+}
+#access li:hover > a,
+#access ul ul :hover > a {
+ background: #000;
+ color: #fff;
+}
+#access ul li:hover > ul {
+ display: block;
+}
+
+#access ul li a:hover {
+ background: #000;
+ color: #fff;
+ border-top:3px solid #f71c9d;
+}
+
+#access ul li ul li a:hover,
+#access ul li ul li ul li a:hover {
+ background: #FFF;
+ color: #000;
+ border-top:3px solid #FFF;
+}
+
+#access ul li.current_page_item a,
+#access ul li.current_page_ancestor a,
+#access ul li.current-menu-ancestor a,
+#access ul li.current-menu-item a,
+#access ul li.current-menu-parent a {
+ color: #fff;
+ border-top:3px solid #f71c9d;
+}
+
+#access ul li.current_page_ancestor ul li.current_page_item a,
+#access ul li.current_page_ancestor ul li a,
+#access ul li.current-menu-item ul li a {border-top:3px solid #000;}
+
+
+/* Main Layout
+---------------------------*/
+#main {
+ width:960px; padding:20px 0;
+ background:url(images/main_bg.gif) left repeat-y;
+}
+
+#container {
+ float: left;
+ margin: 0; padding:0 10px 0 10px;
+ width: 550px;
+}
+#content {margin:0 20px;}
+
+#primary{
+ float: left;
+ overflow: hidden;
+ width: 195px;
+ padding: 0;
+}
+
+#secondary {
+ float: right;
+ overflow: hidden;
+ width: 195px;
+}
+/* Sticky post on home page
+---------------------------------------*/
+.home .sticky {
+ background: #FFF;
+ border-top: 0px;
+ margin: 0px; padding: 20px 0;
+}
+.home .sticky .page-link a {background:#FFF; border:1px dotted #000;}
+.home .sticky .page-link a:hover {color:#f71c9d;}
+/* Sidebar
+---------------------------------------*/
+
+#main .widget-area ul {
+ margin-left: 0;
+ padding: 0;
+}
+.widget-title {
+ color: #000;
+ border-top:1px dotted #000;
+ border-bottom:1px dotted #000;
+ padding: 2px 10px;
+}
+
+#main .widget-area ul ul {
+ margin: 0 20px 0 25px;
+}
+
+.tagcloud {
+ padding: 5px 10px;
+}
+#calendar_wrap {padding:10px;}
+
+/* Main content area
+-------------------------------------*/
+#content .entry-title {
+ color: #FFF;
+ font-size: 21px;
+ font-weight: bold;
+ line-height: 1.3em;
+ margin: 0 0 0 -30px; padding: 2px 20px 2px 30px;
+ background:#000;
+}
+.entry-title a:link,
+.entry-title a:visited {
+ color: #FFF;
+ text-decoration: none;
+}
+.entry-title a:active,
+.entry-title a:hover {
+ color: #f71c9d;
+}
+
+.entry-meta a,
+.entry-utility a {
+ color: #f71c9d;
+}
+.entry-meta a:hover,
+.entry-utility a:hover {
+ color: #fb8fcf;
+}
+
+/* Navigation to previous and next post
+-------------------------------------------------------------- */
+
+.navigation {
+ color: #000;
+ font-size: 12px;
+ line-height: 18px;
+ overflow: hidden;
+ border-top:1px dotted #000;
+ border-bottom:1px dotted #000;
+ padding:2px;
+}
+.navigation a:link,
+.navigation a:visited {
+ color: #000;
+ text-decoration: none;
+}
+.navigation a:active,
+.navigation a:hover {
+ color: #f71c9d;
+}
+
+/* Footer
+------------------------------------*/
+
+#colophon {width:960px;}
+
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.