Beispiel #1
0
    echo $before . esc_html($current_term->name) . $after;
} elseif (is_day()) {
    echo $before . '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a>' . $after . $delimiter;
    echo $before . '<a href="' . get_month_link(get_the_time('Y'), get_the_time('m')) . '">' . get_the_time('F') . '</a>' . $after . $delimiter;
    echo $before . get_the_time('d') . $after;
} elseif (is_month()) {
    echo $before . '<a href="' . get_year_link(get_the_time('Y')) . '">' . get_the_time('Y') . '</a>' . $after . $delimiter;
    echo $before . get_the_time('F') . $after;
} elseif (is_year()) {
    echo $before . get_the_time('Y') . $after;
} elseif (is_post_type_archive()) {
    $post_type = get_post_type_object('event');
    $name = $post_type->labels->name;
    if (is_search()) {
        echo $before . '<a href="' . get_post_type_archive_link($post_type->name) . '">' . $name . '</a>' . $delimiter . __('Search results for &ldquo;', 'events-maker') . get_search_query() . '&rdquo;' . $after;
    } elseif (em_is_event_archive() && get_query_var('event_ondate')) {
        echo $before . '<a href="' . get_post_type_archive_link($post_type->name) . '">' . $name . '</a>' . $delimiter . get_query_var('event_ondate') . $after;
    } elseif (is_paged()) {
        echo $before . '<a href="' . get_post_type_archive_link($post_type->name) . '">' . $name . '</a>' . $after;
    } else {
        echo $before . $name . $after;
    }
} elseif (is_single() && !is_attachment()) {
    if (get_post_type() != 'post') {
        $post_type = get_post_type_object(get_post_type());
        $slug = $post_type->rewrite;
        echo $before . '<a href="' . get_post_type_archive_link(get_post_type()) . '">' . $post_type->labels->name . '</a>' . $after . $delimiter;
        if (get_post_type() == 'event') {
            if ($terms = wp_get_post_terms($post->ID, 'event-category', array('orderby' => 'parent', 'order' => 'DESC'))) {
                $main_term = $terms[0];
                $ancestors = get_ancestors($main_term->term_id, 'event-category');
 function em_page_title($echo = true)
 {
     if (em_is_event_archive('day')) {
         $page_title = sprintf(__('Event Daily Archives: %s', 'events-maker'), '<span>' . get_the_date() . '</span>');
     } elseif (em_is_event_archive('month')) {
         $page_title = sprintf(__('Event Monthly Archives: %s', 'events-maker'), '<span>' . get_the_date(_x('F Y', 'monthly archives date format', 'events-maker')) . '</span>');
     } elseif (em_is_event_archive('year')) {
         $page_title = sprintf(__('Event Yearly Archives: %s', 'events-maker'), '<span>' . get_the_date(_x('Y', 'yearly archives date format', 'events-maker')) . '</span>');
     } elseif (is_tax('event-category')) {
         $page_title = sprintf(__('Events Category: %s', 'events-maker'), single_term_title('', false));
     } elseif (is_tax('event-location')) {
         $page_title = sprintf(__('Events Location: %s', 'events-maker'), single_term_title('', false));
     } elseif (is_tax('event-organizer')) {
         $page_title = sprintf(__('Events Organizer: %s', 'events-maker'), single_term_title('', false));
     } elseif (is_tax('event-tag')) {
         $page_title = sprintf(__('Events Tag: %s', 'events-maker'), single_term_title('', false));
     } else {
         $page_title = __('Events', 'events-maker');
     }
     $page_title = apply_filters('em_page_title', $page_title);
     if ($echo) {
         echo $page_title;
     } else {
         return $page_title;
     }
 }