Skip to content

Commit

Permalink
Changing directions
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed May 3, 2011
1 parent e9eee52 commit 6f6a7bf
Show file tree
Hide file tree
Showing 5 changed files with 197 additions and 5 deletions.
44 changes: 43 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ function init() {
function register_menus() {
register_nav_menus(
array(
'primary-navigation' => __( 'Header Menu' )
'primary-navigation' => 'Primary Navigation',
'sidebar-taxonomy-places' => 'Taxonomy Sidebar: Places'
)
);
} // END register_menus()
Expand All @@ -57,6 +58,7 @@ function enqueue_resources() {

if ( !is_admin() ) {
wp_enqueue_style( 'cngnyc_primary_css', get_bloginfo('template_directory') . '/style.css', false, CNGNYC_VERSION );
wp_enqueue_style( 'custom_font_css', 'http://fonts.googleapis.com/css?family=Droid+Serif:regular,italic,bold,bolditalic', false, CNGNYC_VERSION );
}

} // END enqueue_resources()
Expand Down Expand Up @@ -223,4 +225,44 @@ function after_setup_theme() {
global $cngnyc;
$cngnyc = new cngnyc();

/**
* cngnyc_get_term_base()
*/
function cngnyc_get_term_base( $term_object ) {

if ( !is_object( $term_object ) ) {
return false;
}

switch( $term_object->taxonomy ) {
case 'cngnyc_classes':
return 'classes';
break;
case 'cngnyc_topics':
return 'topics';
break;
case 'cngnyc_places':
return 'places';
break;
default:
return false;
}

} // END cngnyc_get_term_base()

/**
* cngnyc_is_post_term()
*/
function cngnyc_is_post_term( $term_object, $post_terms = array() ) {

if ( !is_object( $term_object ) || empty( $post_terms ) ) {
return false;
}

foreach ( $post_terms as $post_term ) {

}

} // END cngnyc_is_post_term()

?>
8 changes: 6 additions & 2 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="copyright" content="Copyright <?php echo date('Y'); ?> City University of New York Graduate School of Journalism" />
<meta http-equiv="content-language" content="en" />

<title><?php wp_title(); ?></title>
<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>

<?php
/**
Expand All @@ -19,7 +19,7 @@
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/images/favicon.ico" type="image/x-icon" />

<?php wp_head(); ?>
<?php wp_head(); ?>

</head>

Expand All @@ -28,6 +28,10 @@
<div class="header">

<div class="wrap">

<h1 class="site-title"><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>

<div class="site-description"><?php bloginfo('description'); ?></div>

</div><!-- END .wrap -->

Expand Down
25 changes: 25 additions & 0 deletions sidebar-left.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<div class="sidebar-taxonomy sidebar float-left">

<?php
$taxonomies = array(
'cngnyc_classes',
'cngnyc_topics',
'cngnyc_places',
);
$args = array(
'orderby' => 'slug',
);
$all_terms = get_terms( $taxonomies, $args );

if ( is_single() ) {
$post_terms = wp_get_object_terms( $post->ID, $taxonomies );
var_dump( $post_terms );
}
?>
<ul class="all-terms">
<?php foreach( $all_terms as $single_term ): ?>
<li class="single-term"><a href="<?php bloginfo('url'); ?>/<?php echo cngnyc_get_term_base( $single_term ) . '/' . $single_term->slug . '/'; ?>"><?php echo $single_term->name; ?></a></li>
<?php endforeach; ?>
</ul>

</div>
6 changes: 5 additions & 1 deletion single.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

<div class="main">

<?php get_sidebar('left'); ?>

<div class="wrap">

<div class="content">

<div class="post">

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

<h2><?php the_title() ?></h2>

<div class="meta">By <?php if ( function_exists( 'co_authors' ) ) { co_authors(); } else { the_author(); } ?> <a href="<?php the_permalink(); ?>">&#8734;</a></div>

<div class="entry">
<?php the_content(); ?>
Expand Down
119 changes: 118 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,121 @@ Author URI: http://www.journalism.cuny.edu/
Version: 0.0
License: GNU General Public License
License URI: license.txt
*/
*/

body, html, h1, h2, h3, h4, h5, h6, p, ul, ol, li {
margin: 0;
padding: 0;
}

body {
font-family: "Georgia", "Times", serif;
font-size: 12px;
line-height: 18px;
background-color: #EEEEEE;
}

.wrap {
width: 900px;
margin-left: 150px;
margin-right: auto;
background-color: #FFFFFF;
}

.float-left {
float: left;
}

.float-right {
float-right
}

a {
text-decoration: none;
}

a:hover {
text-decoration: underline;
}

h1 {
font-size: 36px;
line-height: 48px;
}

h2 {
font-size: 30px;
line-height: 38px;
}

h3 {

}

h4 {

}

p, ul, ol {
padding-top: 5px;
padding-bottom: 5px;
}

.post h2, .post h3 {
font-family: "Droid Serif", "Georgia", "Times", serif;
}

.post .entry {
font-size: 14px;
line-height: 20px;
}

/**
* Property: width
*/
body.single .main .wrap {
padding-left: 20px;
padding-right: 20px;
width: 600px;
}

/**
* Page: Single
*/

body.single .header .wrap {
background-color: #EEEEEE;
padding-top: 10px;
padding-bottom: 10px;
}

body.single .header .wrap h1 {
font-size: 24px;
line-height: 32px;
font-weight: normal;
}

body.single .header .wrap h1 a {
color: #777777;
}

body.single .header .wrap .site-description {
color: #888888;
}

/**
* Element: sidebar.sidebar-taxonomy
*/
.sidebar.sidebar-taxonomy {
text-align: right;
padding-right: 5px;
width: 150px;
}

.sidebar.sidebar-taxonomy ul {

}

.sidebar.sidebar-taxonomy ul li {
list-style-type: none;
}

0 comments on commit 6f6a7bf

Please sign in to comment.