-
-
Save rachelmccollin/2b693721668dba8bcc578b8de9824642 to your computer and use it in GitHub Desktop.
WPMU Create a WordPress theme from static HTML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2><?php the_archive_title(); ?></h2> | |
<?php get_template_part( 'includes/loop', 'archive' ); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<article class="post"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body <?php body_class(); ?>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body class="home blog logged-in admin-bar no-customize-support" data-gr-c-s-loaded="true" style=""> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section class="entry-meta"> | |
<?php echo get_the_date(); ?> | |
</section><!-- .entry-meta --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_header(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_template_part( 'includes/loop' ); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_template_part( 'includes/loop', 'page' ); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!--[if lt IE 7]><html lang="en-US" class="ie6"><![endif]--> | |
<!--[if IE 7]><html lang="en-US" class="ie7"><![endif]--> | |
<!--[if IE 8]><html lang="en-US" class="ie8"><![endif]--> | |
<!--[if IE 9]><html lang="en-US" class="ie9"><![endif]--> | |
<!--[if gt IE 9]><html lang="en-US"><![endif]--> | |
<!--[if !IE]><html lang="en-US"><![endif]--> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<title>WordPress Writer and Instructor | RACHEL McCOLLIN</title> | |
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> | |
<link href="https://fonts.googleapis.com/css?family=Assistant|Oswald" rel="stylesheet"> | |
<?php wp_head(); ?> | |
</head> | |
<body <?php body_class(); ?>> | |
<div class="header-bg"> | |
<header role="banner"> | |
<hgroup class="site-name three-quarters left"> | |
<!-- site name and description - site name is inside a div element on all pages execpt the front page and/or main blog page, where it is in a h1 element --> | |
<h1 id="site-title" class="one-half-left"> | |
<a href="https://rachelmccollin.com/" title="RACHEL McCOLLIN" rel="home">RACHEL McCOLLIN</a> | |
</h1> | |
<h2 id="site-description">Fiction and Technical Writer</h2> | |
</hgroup> | |
<div class="right quarter"> | |
<a class="toggle-nav" href="#">☰</a> | |
</div> <!-- .right quarter --> | |
</header><!-- header --> | |
</div><!-- header-bg--> | |
<!-- full width navigation menu --> | |
<nav class="menu main"> | |
<div class="skip-link screen-reader-text"><a href="#content" title="Skip to content">Skip to content</a></div> | |
<div class="main-nav"> | |
<ul class="menu"> | |
<li class="menu-item"><a href="https://rachelmccollin.com/">Home</a></li> | |
<li class="menu-item"><a href="https://rachelmccollin.com/about-me/">About Me</a></li> | |
<li class="menu-item"><a href="https://rachelmccollin.com/books/">Books</a></li> | |
<li class="menu-item"><a href="https://rachelmccollin.com/bookclub/">Book Club</a></li> | |
<li class="menu-item"><a href="https://rachelmccollin.com/blog/">Blog</a></li> | |
<li class="menu-item"><a href="https://rachelmccollin.com/contact/">Contact</a></li> | |
</ul> | |
</div> | |
</nav><!-- .main --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<title>WordPress Writer and Instructor | RACHEL McCOLLIN</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* The main index file */ | |
?> | |
<?php get_header(); ?> | |
<div class="main"> | |
<div id="content" class="two-thirds left"> | |
<?php get_template_part( 'includes/loop' ); ?> | |
</div><!-- #content --> | |
<?php get_sidebar(); ?> | |
<?php get_footer(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* The main index file */ | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php while ( have_posts() ) : the_post(); //Open the loop ?> | |
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> | |
<h3 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> | |
<section class="entry-meta"> | |
<?php echo get_the_date(); ?> | |
</section><!-- .entry-meta --> | |
<section class="entry-content"> | |
<?php the_content(); ?> | |
</section><!-- .entry-content --> | |
</article> | |
<?php endwhile; // End the loop. ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php while ( have_posts() ) : the_post(); //Open the loop ?> | |
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> | |
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> | |
<section class="entry-meta"> | |
<?php echo get_the_date(); ?> | |
</section><!-- .entry-meta --> | |
<section class="entry-content"> | |
<?php the_content(); ?> | |
</section><!-- .entry-content --> | |
<section class="entry-utility"> | |
<?php comments_template(); ?> | |
</section><!-- .entry-utility --> | |
</article> | |
<?php endwhile; // End the loop. ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php while ( have_posts() ) : the_post(); //Open the loop ?> | |
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> | |
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> | |
<section class="entry-meta"> | |
<?php echo get_the_date(); ?> | |
</section><!-- .entry-meta --> | |
<section class="entry-content"> | |
<?php the_content(); ?> | |
</section><!-- .entry-content --> | |
<section class="entry-utility"> | |
<?php comments_template(); ?> | |
</section><!-- .entry-utility --> | |
</article> | |
<?php endwhile; // End the loop. ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<title>WordPress Writer and Instructor | RACHEL McCOLLIN</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* The template file for dispalying static pages */ | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2 class="entry-title"><?php the_title(); ?></h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**************************************************************************** | |
Register widgets | |
****************************************************************************/ | |
function wpmu_register_widgets() { | |
// Sidebar widget area, located in the sidebar. Empty by default. | |
register_sidebar( array( | |
'name' => __( 'Sidebar Widget Area', 'wpmu' ), | |
'id' => 'sidebar-widget-area', | |
'description' => __( 'The sidebar widget area', 'wpmu' ), | |
'before_widget' => '<div id="%1$s" class="widget-container %2$s">', | |
'after_widget' => '</div>', | |
'before_title' => '<h3 class="widget-title">', | |
'after_title' => '</h3>', | |
) ); | |
// First footer widget area, located in the footer. Empty by default. | |
register_sidebar( array( | |
'name' => __( 'First Footer Widget Area', 'wpmu' ), | |
'id' => 'first-footer-widget-area', | |
'description' => __( 'The first footer widget area', 'wpmu' ), | |
'before_widget' => '<div id="%1$s" class="widget-container %2$s">', | |
'after_widget' => '</div>', | |
'before_title' => '<h3 class="widget-title">', | |
'after_title' => '</h3>', | |
) ); | |
// Second Footer Widget Area, located in the footer. Empty by default. | |
register_sidebar( array( | |
'name' => __( 'Second Footer Widget Area', 'wpmu' ), | |
'id' => 'second-footer-widget-area', | |
'description' => __( 'The second footer widget area', 'wpmu' ), | |
'before_widget' => '<div id="%1$s" class="widget-container %2$s">', | |
'after_widget' => '</div>', | |
'before_title' => '<h3 class="widget-title">', | |
'after_title' => '</h3>', | |
) ); | |
// Third Footer Widget Area, located in the footer. Empty by default. | |
register_sidebar( array( | |
'name' => __( 'Third Footer Widget Area', 'wpmu' ), | |
'id' => 'third-footer-widget-area', | |
'description' => __( 'The third footer widget area', 'wpmu' ), | |
'before_widget' => '<div id="%1$s" class="widget-container %2$s">', | |
'after_widget' => '</div>', | |
'before_title' => '<h3 class="widget-title">', | |
'after_title' => '</h3>', | |
) ); | |
} | |
add_action( 'widgets_init', 'wpmu_register_widgets' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* The file for displaying single posts */ | |
?> | |
<?php get_header(); ?> | |
<div class="main"> | |
<div id="content" class="two-thirds left"> | |
<?php get_template_part( 'includes/loop', 'single' ); ?> | |
</div><!-- #content --> | |
<?php get_sidebar(); ?> | |
<?php get_footer(); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2 class="entry-title"><?php the_title(); ?></h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1 id="site-title"> | |
<a href="<?php echo site_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"> | |
<?php bloginfo( 'name' ); ?> | |
</a> | |
</h1> | |
<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1 id="site-title" class="one-half-left"> | |
<a href="https://rachelmccollin.com/" title="RACHEL McCOLLIN" rel="home">RACHEL McCOLLIN</a> | |
</h1> | |
<h2 id="site-description">Fiction and Technical Writer</h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Theme Name: WPMU DEV Basic Theme | |
Theme URI: https://github.com/rachelmccollin/WPMU-DEV-Theme-Development-Series-Files/ | |
Description: Theme to accompany a series of posts on creating a WordPress theme from static HTML. | |
Author: Rachel McCollin | |
Author URI: https://rachelmccollin.com/ | |
Version: 1.0 | |
License: GNU General Public License v2 or later | |
License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" type="text/css" media="all" href="style.css" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/**************************************************************************** | |
Theme setup | |
****************************************************************************/ | |
function wpmu_theme_setup() { | |
// translation | |
load_theme_textdomain( 'wpmu', get_stylesheet_directory() . '/languages' ); | |
// post formats | |
add_theme_support( 'post_formats' ); | |
// Post thumbnails or featured images | |
add_theme_support( 'post-thumbnails', array( 'post', 'page' ) ); | |
// RSS feed links to head | |
add_theme_support( 'automatic-feed-links' ); | |
// navigation menu | |
register_nav_menus( array( | |
'primary' => __( 'Primary Navigation', 'wpmu' ) | |
) ); | |
} | |
add_action( 'after_setup_theme', 'wpmu_theme_setup' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Text Domain: wpmu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php wp_head(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment