';
global $post;
$home = home_url();
echo '
' . $name . ' ';
if (!is_home())
echo $chevron . ' ';
if (is_category()) {
global $wp_query;
$cat_obj = $wp_query->get_queried_object();
$thisCat = $cat_obj->term_id;
$thisCat = get_category($thisCat);
$parentCat = get_category($thisCat->parent);
if ($thisCat->parent != 0)
echo(get_category_parents($parentCat, TRUE, ' ' . $chevron . ' '));
echo $currentBefore . 'Archive by category '';
single_cat_title();
echo ''' . $currentAfter;
} elseif (is_day()) {
echo '
' . get_the_time('Y') . ' ' . $chevron . ' ';
echo '
' . get_the_time('F') . ' ' . $chevron . ' ';
echo $currentBefore . get_the_time('d') . $currentAfter;
} elseif (is_month()) {
echo '
' . get_the_time('Y') . ' ' . $chevron . ' ';
echo $currentBefore . get_the_time('F') . $currentAfter;
} elseif (is_year()) {
echo $currentBefore . get_the_time('Y') . $currentAfter;
} elseif (is_single()) {
$cat = get_the_category();
$cat = $cat[0];
echo get_category_parents($cat, TRUE, ' ' . $chevron . ' ');
echo $currentBefore;
the_title();
echo $currentAfter;
} elseif (is_page() && !$post->post_parent) {
echo $currentBefore;
the_title();
echo $currentAfter;
} elseif (is_page() && $post->post_parent) {
$parent_id = $post->post_parent;
$breadcrumb_lists = array();
while ($parent_id) {
$page = get_page($parent_id);
$breadcrumb_lists[] = '
' . get_the_title($page->ID) . '';
$parent_id = $page->post_parent;
}
$breadcrumb_lists = array_reverse($breadcrumb_lists);
foreach ($breadcrumb_lists as $crumb)
echo $crumb . ' ' . $chevron . ' ';
echo $currentBefore;
the_title();
echo $currentAfter;
} elseif (is_search()) {
echo $currentBefore . 'Search results for '' . get_search_query() . ''' . $currentAfter;
} elseif (is_tag()) {
echo $currentBefore . 'Posts tagged '';
single_tag_title();
echo ''' . $currentAfter;
} elseif (is_author()) {
global $author;
$userdata = get_userdata($author);
echo $currentBefore . 'Articles posted by ' . $userdata->display_name . $currentAfter;
} elseif (is_404()) {
echo $currentBefore . 'Error 404' . $currentAfter;
}
if (get_query_var('paged')) {
if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author())
echo ' (';
echo __('Page','shell') . ' ' . get_query_var('paged');
if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author())
echo ')';
}
echo '
';
}
/**
* A safe way of adding javascripts to a WordPress generated page.
*/
if (!is_admin())
add_action('wp_print_scripts', 'shell_js');
if (!function_exists('shell_js')) {
function shell_js() {
// JavaScript at the bottom for fast page loading.
// except for Modernizr which enables HTML5 elements & feature detects.
wp_enqueue_script('modernizr', get_template_directory_uri() . '/js/modernizr.js', array('jquery'), '2.0.6', false);
wp_enqueue_script('scripts', get_template_directory_uri() . '/js/scripts.js', array('jquery'), '1.0.4', true);
}
}
/**
* Where the post has no post title, but must still display a link to the single-page post view.
*/
add_filter('the_title', 'shell_title');
function shell_title($title) {
if ($title == '') {
return 'Untitled';
} else {
return $title;
}
}
/**
* WordPress Widgets start right here.
*/
function shell_widgets_init() {
register_sidebar(array(
'name' => __('Primary Sidebar Widget', 'shell'),
'description' => __('Area One Primary Widget', 'shell'),
'id' => 'primary-sidebar-widget',
'before_title' => '