Skip to content

Commit

Permalink
Prototype updates to get this thing ready for beta.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.locallylost.com/themes/prototype/trunk@398 dba0f204-706d-4bc1-bc29-8b92e0485636
  • Loading branch information
greenshady committed Oct 15, 2010
1 parent a1b4520 commit 19f0302
Show file tree
Hide file tree
Showing 10 changed files with 993 additions and 945 deletions.
45 changes: 40 additions & 5 deletions functions.php
Expand Up @@ -45,13 +45,13 @@ function prototype_theme_setup() {
/* Add theme support for extensions. */
add_theme_support( 'post-layouts' );
add_theme_support( 'post-stylesheets' );
add_theme_support( 'dev-stylesheet' );
add_theme_support( 'loop-pagination' );
add_theme_support( 'get-the-image' );
add_theme_support( 'breadcrumb-trail' );

/* Add theme support for WordPress features. */
add_theme_support( 'automatic-feed-links' );

/* Allow users to upload a custom background. */
add_custom_background();

/* Register menus. */
Expand All @@ -75,18 +75,35 @@ function prototype_theme_setup() {
add_filter( 'breadcrumb_trail_args', 'prototype_breadcrumb_trail_args' );
}

/**
* Unregisters some of the core framework sidebars that the theme doesn't use.
*
* @since 0.1.0
*/
function prototype_unregister_sidebars() {
unregister_sidebar( 'before-content' );
unregister_sidebar( 'after-content' );
}

/**
* Custom breadcrumb trail arguments.
*
* @since 0.1.0
*/
function prototype_breadcrumb_trail_args( $args ) {

/* Change the text before the breadcrumb trail. */
$args['before'] = __( 'You are here:', hybrid_get_textdomain() );

/* Return the filtered arguments. */
return $args;
}

/**
* Function for deciding which pages should have a one-column layout.
*
* @since 0.1.0
*/
function prototype_one_column() {

if ( !is_active_sidebar( 'primary' ) && !is_active_sidebar( 'secondary' ) )
Expand All @@ -96,18 +113,26 @@ function prototype_one_column() {
add_filter( 'get_post_layout', 'prototype_post_layout_one_column' );
}

/**
* Filters 'get_post_layout' by returning 'layout-1c'.
*
* @since 0.1.0
*/
function prototype_post_layout_one_column( $layout ) {
return 'layout-1c';
}

/**
* Disables sidebars if viewing a one-column page.
*
* @since 0.1.0
*/
function prototype_disable_sidebars( $sidebars_widgets ) {
global $wp_query;

if ( current_theme_supports( 'post-layouts' ) ) {

$layout = post_layouts_get_layout();

if ( 'layout-1c' == $layout ) {
if ( 'layout-1c' == post_layouts_get_layout() ) {
$sidebars_widgets['primary'] = false;
$sidebars_widgets['secondary'] = false;
}
Expand All @@ -116,10 +141,20 @@ function prototype_disable_sidebars( $sidebars_widgets ) {
return $sidebars_widgets;
}

/**
* Registers new sidebars for the theme.
*
* @since 0.1.0.
*/
function prototype_register_sidebars() {
register_sidebar( array( 'name' => __( 'Header', hybrid_get_textdomain() ), 'id' => 'header', 'description' => __( 'Displayed in the header area.', hybrid_get_textdomain() ), 'before_widget' => '<div id="%1$s" class="widget %2$s widget-%2$s"><div class="widget-inside">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) );
}

/**
* Registers new nav menus for the theme.
*
* @since 0.1.0
*/
function prototype_register_menus() {
register_nav_menus(
array(
Expand Down
4 changes: 0 additions & 4 deletions index.php
Expand Up @@ -51,10 +51,6 @@

<?php endwhile; ?>

<?php else : // No posts found ?>

<?php get_template_part( 'loop-error' ); ?>

<?php endif; ?>

</div><!-- .hfeed -->
Expand Down
30 changes: 29 additions & 1 deletion loop-meta.php
Expand Up @@ -10,7 +10,21 @@
*/
?>

<?php if ( is_category() ) : ?>
<?php if ( is_home() && !is_front_page() ) : ?>

<?php global $wp_query; ?>

<div class="loop-meta">

<h1 class="loop-title"><?php echo get_post_field( 'post_title', $wp_query->get_queried_object_id() ); ?></h1>

<div class="loop-description">
<?php echo apply_filters( 'the_excerpt', get_post_field( 'post_excerpt', $wp_query->get_queried_object_id() ) ); ?>
</div><!-- .loop-description -->

</div><!-- .loop-meta -->

<?php elseif ( is_category() ) : ?>

<div class="loop-meta">

Expand Down Expand Up @@ -91,6 +105,20 @@

</div><!-- .loop-meta -->

<?php elseif ( is_archive() && get_query_var( 'post_type' ) ) : ?>

<?php $post_type = get_post_type_object( get_query_var( 'post_type' ) ); ?>

<div class="loop-meta">

<h1 class="loop-title"><?php echo $post_type->labels->name; ?></h1>

<div class="loop-description">
<?php if ( !empty( $post_type->description ) ) echo "<p>{$post_type->description}</p>"; ?>
</div><!-- .loop-description -->

</div><!-- .loop-meta -->

<?php elseif ( is_archive() ) : ?>

<div class="loop-meta">
Expand Down
8 changes: 4 additions & 4 deletions page.php
Expand Up @@ -23,11 +23,11 @@

<?php while ( have_posts() ) : the_post(); ?>

<?php do_atomic( 'before_loop' ); // Before loop hook ?>
<?php do_atomic( 'before_entry' ); // Before entry hook ?>

<div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">

<?php do_atomic( 'open_loop' ); // Open loop hook ?>
<?php do_atomic( 'open_entry' ); // Open entry hook ?>

<?php echo apply_atomic( 'entry_title', the_title( '<h1 class="entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h1>', false ) ); ?>

Expand All @@ -36,11 +36,11 @@
<?php wp_link_pages( array( 'before' => '<p class="page-links">' . __( 'Pages:', hybrid_get_textdomain() ), 'after' => '</p>' ) ); ?>
</div><!-- .entry-content -->

<?php do_atomic( 'close_loop' ); // Close loop hook ?>
<?php do_atomic( 'close_entry' ); // Close entry hook ?>

</div><!-- .hentry -->

<?php do_atomic( 'after_loop' ); // After loop hook ?>
<?php do_atomic( 'after_entry' ); // After entry hook ?>

<?php get_sidebar( 'after-singular' ); ?>

Expand Down
11 changes: 4 additions & 7 deletions searchform.php
Expand Up @@ -7,16 +7,13 @@
* @package Prototype
* @subpackage Template
*/

global $search_num;
++$search_num;
?>
<div id="search<?php if ( $search_num ) echo '-' . $search_num; ?>" class="search">
<div class="search">

<form method="get" class="search-form" id="search-form<?php if ( $search_num ) echo '-' . $search_num; ?>" action="<?php echo trailingslashit( home_url() ); ?>">
<form method="get" class="search-form" action="<?php echo trailingslashit( home_url() ); ?>">
<div>
<input class="search-text" type="text" name="s" id="search-text<?php if ( $search_num) echo '-' . $search_num; ?>" value="<?php if ( is_search() ) echo esc_attr( get_search_query() ); else esc_attr_e( 'Search this site...', hybrid_get_textdomain() ); ?>" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" />
<input class="search-submit button" name="submit" type="submit" id="search-submit<?php if ( $search_num ) echo '-' . $search_num; ?>" value="<?php esc_attr_e( 'Search', hybrid_get_textdomain() ); ?>" />
<input class="search-text" type="text" name="s" value="<?php if ( is_search() ) echo esc_attr( get_search_query() ); else esc_attr_e( 'Search this site...', hybrid_get_textdomain() ); ?>" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" />
<input class="search-submit button" name="submit" type="submit" value="<?php esc_attr_e( 'Search', hybrid_get_textdomain() ); ?>" />
</div>
</form><!-- .search-form -->

Expand Down
4 changes: 2 additions & 2 deletions sidebar-after-singular.php
Expand Up @@ -11,10 +11,10 @@

if ( is_active_sidebar( 'after-singular' ) ) : ?>

<div id="sidebar-after-singular" class="sidebar utility">
<div id="sidebar-after-singular" class="sidebar">

<?php dynamic_sidebar( 'after-singular' ); ?>

</div><!-- #sidebar-after-singular .utility -->
</div><!-- #sidebar-after-singular -->

<?php endif; ?>
9 changes: 3 additions & 6 deletions sidebar-header.php
@@ -1,20 +1,17 @@
<?php
/**
* After Singular Sidebar Template
*
* The After Singular sidebar template houses the HTML used for the 'Utility: After Singular'
* sidebar. If widgets are present, they will be displayed.
* Sidebar Header Template
*
* @package Prototype
* @subpackage Template
*/

if ( is_active_sidebar( 'header' ) ) : ?>

<div id="sidebar-header" class="sidebar utility">
<div id="sidebar-header" class="sidebar">

<?php dynamic_sidebar( 'header' ); ?>

</div><!-- #sidebar-header .utility -->
</div><!-- #sidebar-header -->

<?php endif; ?>
10 changes: 4 additions & 6 deletions singular.php
Expand Up @@ -23,13 +23,11 @@

<?php while ( have_posts() ) : the_post(); ?>

<?php do_atomic( 'before_loop' ); // Before loop hook ?>
<?php do_atomic( 'before_entry' ); // Before entry hook ?>

<div id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">

<?php do_atomic( 'open_loop' ); // Open loop hook ?>

<?php //echo apply_atomic_shortcode( 'entry_utility', '<div class="entry-utility">' . __( '[entry-print-link] [entry-email-link] [entry-popup-shortlink]', hybrid_get_textdomain() ) . '</div>' ); ?>
<?php do_atomic( 'open_entry' ); // Open entry hook ?>

<?php echo apply_atomic( 'entry_title', the_title( '<h1 class="entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h1>', false ) ); ?>

Expand All @@ -42,11 +40,11 @@

<?php echo apply_atomic_shortcode( 'entry_meta', '<div class="entry-meta">' . __( '[entry-terms taxonomy="category" before="Posted in "] [entry-terms taxonomy="post_tag" before="| Tagged "]', hybrid_get_textdomain() ) . '</div>' ); ?>

<?php do_atomic( 'close_loop' ); // Close loop hook ?>
<?php do_atomic( 'close_entry' ); // Close entry hook ?>

</div><!-- .hentry -->

<?php do_atomic( 'after_loop' ); // After loop hook ?>
<?php do_atomic( 'after_entry' ); // After entry hook ?>

<?php get_sidebar( 'after-singular' ); ?>

Expand Down

0 comments on commit 19f0302

Please sign in to comment.