Ejemplo n.º 1
0
 /**
  *
  */
 public function __construct()
 {
     global $post;
     $this->init_args();
     // Don't display on homepage
     if (is_front_page()) {
         return;
     }
     $this->add_crumb('Home', home_url());
     // Blog page
     if (is_home() || is_singular('post')) {
         $this->add_crumb('Blog', get_permalink(get_option('page_for_posts')));
     }
     if (is_archive()) {
         $this->add_post_type_crumb();
     }
     if (is_category()) {
         $category = current(get_the_category());
         $this->add_crumb($category->name, get_category_link($category));
     } elseif (is_single()) {
         $this->add_post_type_crumb();
         $this->add_current_crumb();
     } elseif (is_page()) {
         if ($post->post_parent) {
             $ancestors = get_post_ancestors($post->ID);
             $ancestors = array_reverse($ancestors);
             foreach ($ancestors as $ancestor) {
                 $this->add_crumb(get_the_title($ancestor), get_permalink($ancestor));
             }
         }
         $this->add_current_crumb();
     } elseif (is_tag()) {
         //single_tag_title();
     } elseif (is_tax()) {
         $this->add_crumb(framework_get_queried_object_title());
     } elseif (is_day()) {
         //echo "<li>Archive for "; the_time('F jS, Y'); echo'</li>';
     } elseif (is_month()) {
         $this->add_crumb(get_the_time('Y'), get_year_link(get_the_time('Y')));
         $this->add_crumb(get_the_time('F'));
     } elseif (is_year()) {
         $this->add_crumb(get_the_time('Y'));
     } elseif (is_author()) {
         $this->add_crumb(get_the_author(), false);
     } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
         //echo "<li>Blog Archives"; echo'</li>';
     } elseif (is_search()) {
         //echo "<li>Search Results"; echo'</li>';
     }
 }
Ejemplo n.º 2
0
    if (is_post_type_archive()) {
        echo post_type_archive_title();
    } elseif (is_category()) {
        single_cat_title();
    } elseif (is_tag()) {
        single_tag_title();
    } elseif (is_author()) {
        printf(__('Author: %s', 'framework'), '<span class="vcard">' . get_the_author() . '</span>');
    } elseif (is_day()) {
        printf(__('Day: %s', 'framework'), '<span>' . get_the_date() . '</span>');
    } elseif (is_month()) {
        printf(__('Month: %s', 'framework'), '<span>' . get_the_date(_x('F Y', 'monthly archives date format', 'framework')) . '</span>');
    } elseif (is_year()) {
        printf(__('Year: %s', 'framework'), '<span>' . get_the_date(_x('Y', 'yearly archives date format', 'framework')) . '</span>');
    } elseif (is_tax()) {
        echo framework_get_queried_object_title();
    } else {
        _e('Archives', 'framework');
    }
    ?>
						</h2>
						<?php 
    // Show an optional term description.
    $term_description = term_description();
    if (!empty($term_description)) {
        printf('<div class="taxonomy-description">%s</div>', $term_description);
    }
    ?>
					</header>

					<?php