/** * [UNFINISHED] Generates a breadcrumb or the current page. * * @return string The breadcrumb HTML */ function get_the_breadcrumb() { global $post; $str = '<ul id="breadcrumbs">'; if (!is_home()) { $str .= sprintf('<li><a href="%1$s">Home</a></li><li class="separator"> / </li>', home_url('/')); if (is_category() || is_single()) { $categories = get_the_category(); if ($categories) { $cats = array(); foreach (array_slice($categories, 0, 3) as $category) { $cats[] = sprintf('<li><a href="%1$s">%2$s</a></li>', get_category_link($category->term_id), $category->cat_name); } $str .= implode('<li class="separator"> / </li>', $cats); } if (is_single()) { $str .= '<li class="separator"> / </li><li>' . get_the_title() . '</li>'; } } elseif (is_page()) { if ($post->post_parent) { $anc = get_post_ancestors($post->ID); $title = get_the_title(); foreach ($anc as $ancestor) { $output = '<li><a href="' . get_permalink($ancestor) . '" title="' . get_the_title($ancestor) . '">' . get_the_title($ancestor) . '</a></li> <li class="separator">/</li>'; } $str .= $output; $str .= '<strong title="' . $title . ' "> ' . $title . '</strong>'; } else { $str .= '<li><strong> ' . get_the_title() . '</strong></li>'; } } } elseif (is_tag()) { single_tag_title(); } elseif (is_day()) { $str .= "<li>Archive for "; theme::time('F jS, Y'); $str .= '</li>'; } elseif (is_month()) { $str .= "<li>Archive for "; theme::time('F, Y'); $str .= '</li>'; } elseif (is_year()) { $str .= "<li>Archive for "; theme::time('Y'); $str .= '</li>'; } elseif (is_author()) { $str .= "<li>Author Archive"; $str .= '</li>'; } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { $str .= "<li>Blog Archives"; $str .= '</li>'; } elseif (is_search()) { $str .= "<li>Search Results"; $str .= '</li>'; } $str .= '</ul>'; }
printf('<a href="%2$s" class="fn author-with-link" itemprop="name" title="%3$s" rel="nofollow author external">%1$s</a>', $author, esc_url($author_url), esc_attr(sprintf(__("Visit %s’s website", theme::$text_domain), $author))); } else { printf('<span class="fn author-no-link" itemprop="name">%1$s</span>', $author); } ?> </span> on <time class="updated" datetime="<?php theme::time('m-d-Y H:i'); ?> " itemprop="datePublished" content="<?php theme::time('c'); ?> "> <?php theme::time(); ?> </time> </div> </div> </article> <?php if (is_singular()) { if (comments_open() || '0' != get_comments_number()) { comments_template(); } } } ?> <?php