function presscore_search_title_shortcode()
 {
     $title = '';
     $wrap_class = '';
     if (is_search()) {
         $title = get_search_query();
     } else {
         if (is_archive()) {
             if (is_category()) {
                 $title = single_cat_title('', false);
             } elseif (is_tag()) {
                 $title = single_tag_title('', false);
             } elseif (is_author()) {
                 the_post();
                 $title = '<a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta("ID"))) . '" title="' . esc_attr(get_the_author()) . '" rel="me">' . get_the_author() . '</a>';
                 $wrap_class .= ' vcard';
                 rewind_posts();
             } elseif (is_day()) {
                 $title = '<span>' . get_the_date() . '</span>';
             } elseif (is_month()) {
                 $title = '<span>' . get_the_date('F Y');
             } elseif (is_year()) {
                 $title = '<span>' . get_the_date('Y');
             } elseif (is_tax('dt_portfolio_category')) {
                 $title = single_term_title('', false);
             } elseif (is_tax('dt_gallery_category')) {
                 $title = single_term_title('', false);
             }
         }
     }
     if ($title) {
         $title = '<span' . ($wrap_class ? ' class="' . esc_attr($wrap_class) . '"' : '') . '>' . $title . '</span>';
     }
     return $title;
 }
Esempio n. 2
0
 function dez_mp_theme_wp_title($title, $sep)
 {
     global $paged, $page;
     $site_title = get_bloginfo('name');
     $post_title = the_title_attribute('echo=0');
     $site_description = get_bloginfo('description', 'display');
     $sep = '&raquo;';
     if (is_feed()) {
         $title = $site_title;
     } elseif ($site_description && (is_home() || is_front_page())) {
         $title = "{$site_title} {$sep} {$site_description}";
     } elseif ($paged >= 2 || $page >= 2) {
         $title = "{$site_title} {$sep} " . sprintf(__('Page %s', 'mesocolumn'), max($paged, $page));
     } elseif (is_category() || is_tag()) {
         $title = ucfirst(single_cat_title('', false)) . ' ' . $sep . ' ' . $site_title;
     } elseif (is_singular()) {
         $title = "{$post_title} {$sep} {$site_title}";
     } else {
         if (is_day()) {
             $title = __('Archives for ', 'mesocolumn') . get_the_date() . ' ' . $sep . ' ' . $site_title;
         } else {
             if (is_month()) {
                 $title = __('Archives for ', 'mesocolumn') . get_the_date('F Y') . ' ' . $sep . ' ' . $site_title;
             } else {
                 if (is_year()) {
                     $title = __('Archives for ', 'mesocolumn') . get_the_date('Y') . ' ' . $sep . ' ' . $site_title;
                 }
             }
         }
     }
     return $title;
 }
Esempio n. 3
0
/**
 * Page titles
 */
function stachestack_title()
{
    if (is_home()) {
        if (get_option('page_for_posts', true)) {
            $title = get_the_title(get_option('page_for_posts', true));
        } else {
            $title = __('Latest Posts', 'stachestack');
        }
    } elseif (is_archive()) {
        $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
        if ($term) {
            $title = apply_filters('single_term_title', $term->name);
        } elseif (is_post_type_archive()) {
            $title = apply_filters('the_title', get_queried_object()->labels->name);
        } elseif (is_day()) {
            $title = sprintf(__('Daily Archives: %s', 'stachestack'), get_the_date());
        } elseif (is_month()) {
            $title = sprintf(__('Monthly Archives: %s', 'stachestack'), get_the_date('F Y'));
        } elseif (is_year()) {
            $title = sprintf(__('Yearly Archives: %s', 'stachestack'), get_the_date('Y'));
        } elseif (is_author()) {
            $title = sprintf(__('Author Archives: %s', 'stachestack'), get_queried_object()->display_name);
        } else {
            $title = single_cat_title('', false);
        }
    } elseif (is_search()) {
        $title = sprintf(__('Search Results for %s', 'stachestack'), get_search_query());
    } elseif (is_404()) {
        $title = __('Not Found', 'stachestack');
    } else {
        $title = get_the_title();
    }
    return apply_filters('stachestack_title', $title);
}
Esempio n. 4
0
function family_banner()
{
    ?>
	<div class="banner">
		<div class="wrap">
			<?php 
    if (is_front_page()) {
        family_get_header_image();
    } elseif (!is_front_page() && get_theme_mod('family_header_home')) {
        echo '';
    } else {
        // get title
        $id = get_option('page_for_posts');
        if ('posts' == get_option('show_on_front') && (is_day() || is_month() || is_year() || is_tag() || is_category() || is_singular('post') || is_home())) {
            family_get_header_image();
        } elseif (is_home() || is_singular('post')) {
            if (has_post_thumbnail($id)) {
                echo get_the_post_thumbnail($id, 'full');
            } else {
                family_get_header_image();
            }
        } elseif (has_post_thumbnail() && is_singular('page')) {
            the_post_thumbnail();
        } else {
            family_get_header_image();
        }
    }
    ?>
		</div><!-- .wrap -->
  	</div><!-- .banner -->
<?php 
}
Esempio n. 5
0
/**
 * Page titles
 */
function roots_title()
{
    if (is_home()) {
        if (get_option('page_for_posts', true)) {
            return get_the_title(get_option('page_for_posts', true));
        } else {
            return __('Most Recent Posts', 'roots');
        }
    } elseif (is_archive()) {
        $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
        if ($term) {
            return apply_filters('single_term_title', $term->name);
        } elseif (is_post_type_archive()) {
            return apply_filters('the_title', get_queried_object()->labels->name);
        } elseif (is_day()) {
            return sprintf(__('Old Posts, Organized by Day: %s', 'roots'), get_the_date());
        } elseif (is_month()) {
            return sprintf(__('Old Posts, Organized by Month: %s', 'roots'), get_the_date('F Y'));
        } elseif (is_year()) {
            return sprintf(__('Old Posts, Organized by Year: %s', 'roots'), get_the_date('Y'));
        } elseif (is_author()) {
            $author = get_queried_object();
            return sprintf(__('Old Posts, Organized by Author: %s', 'roots'), apply_filters('the_author', is_object($author) ? $author->display_name : null));
        } else {
            return single_cat_title('', false);
        }
    } elseif (is_search()) {
        return sprintf(__('Search Results for %s', 'roots'), get_search_query());
    } elseif (is_404()) {
        return __('Not Found', 'roots');
    } else {
        return get_the_title();
    }
}
Esempio n. 6
0
/**
 * Page titles
 */
function pinnacle_title()
{
    if (is_home()) {
        if (get_option('page_for_posts', true)) {
            return get_the_title(get_option('page_for_posts', true));
        } else {
            return __('Latest Posts', 'pinnacle');
        }
    } elseif (is_archive()) {
        $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
        if ($term) {
            return $term->name;
        } elseif (is_post_type_archive()) {
            return get_queried_object()->labels->name;
        } elseif (is_day()) {
            return sprintf(__('Daily Archives: %s', 'pinnacle'), get_the_date());
        } elseif (is_month()) {
            return sprintf(__('Monthly Archives: %s', 'pinnacle'), get_the_date('F Y'));
        } elseif (is_year()) {
            return sprintf(__('Yearly Archives: %s', 'pinnacle'), get_the_date('Y'));
        } elseif (is_author()) {
            return sprintf(__('Author Archives: %s', 'pinnacle'), get_the_author());
        } else {
            return single_cat_title("", false);
        }
    } elseif (is_search()) {
        return sprintf(__('Search Results for %s', 'pinnacle'), get_search_query());
    } elseif (is_404()) {
        return __('Not Found', 'pinnacle');
    } else {
        return get_the_title();
    }
}
Esempio n. 7
0
/**
 * Page titles
 */
function dw_timeline_title()
{
    if (is_home()) {
        if (get_option('page_for_posts', true)) {
            return get_the_title(get_option('page_for_posts', true));
        } else {
            return get_bloginfo('name');
        }
    } elseif (is_archive()) {
        $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
        if ($term) {
            return apply_filters('single_term_title', $term->name);
        } elseif (is_post_type_archive()) {
            return apply_filters('the_title', get_queried_object()->labels->name);
        } elseif (is_day()) {
            return sprintf(__('Daily Archives: %s', 'dw-timeline'), get_the_date());
        } elseif (is_month()) {
            return sprintf(__('Monthly Archives: %s', 'dw-timeline'), get_the_date('F Y'));
        } elseif (is_year()) {
            return sprintf(__('Yearly Archives: %s', 'dw-timeline'), get_the_date('Y'));
        } elseif (is_author()) {
            $author = get_queried_object();
            return sprintf(__('Author Archives: %s', 'dw-timeline'), $author->display_name);
        } else {
            return single_cat_title('', false);
        }
    } elseif (is_search()) {
        return sprintf(__('Search Results for %s', 'dw-timeline'), get_search_query());
    } elseif (is_404()) {
        return __('Not Found', 'dw-timeline');
    } else {
        return get_the_title();
    }
}
Esempio n. 8
0
 function warrior_archive_title()
 {
     global $wp_query;
     $title = '';
     if (is_category()) {
         $title = sprintf(__('%s <span>Category Archives</span>', 'familia'), single_cat_title('', false));
     } elseif (is_tag()) {
         $title = sprintf(__('%s <span>Tag Archives</span>', 'familia'), single_tag_title('', false));
     } elseif (get_post_format()) {
         $title = sprintf(__('Post Format: %s', 'familia'), get_post_format_string(get_post_format()));
     } elseif (is_day()) {
         $title = sprintf(__('%s <span>Daily Archives</span>', 'familia'), date_i18n('d', strtotime(get_the_date('Y-m-d'), false)));
     } elseif (is_month()) {
         $title = sprintf(__('%s <span>Monthly Archives</span>', 'familia'), date_i18n('F', strtotime(get_the_date('Y-m-d'), false)));
     } elseif (is_year()) {
         $title = sprintf(__('%s <span>Yearly Archives</span>', 'familia'), date_i18n('F', strtotime(get_the_date('Y-m-d'), false)));
     } elseif (is_author()) {
         $author = get_user_by('slug', get_query_var('author_name'));
         $title = sprintf(__('%s <span>Author Archives</span>', 'familia'), get_the_author_meta('display_name', $author->ID));
     } elseif (is_search()) {
         if ($wp_query->found_posts) {
             $title = sprintf(__('Search Results for: "%s"', 'familia'), esc_attr(get_search_query()));
         } else {
             $title = sprintf(__('No Results for: "%s"', 'familia'), esc_attr(get_search_query()));
         }
     } elseif (is_404()) {
         $title = __('Not Found', 'familia');
     } elseif (is_home() || is_front_page() || is_single()) {
         $title = '';
     } else {
         $title = __('Blog', 'familia');
     }
     return $title;
 }
Esempio n. 9
0
/**
 * Page titles
 */
function ya_title()
{
    if (is_home()) {
        if (get_option('page_for_posts', true)) {
            echo get_the_title(get_option('page_for_posts', true));
        } else {
            esc_html_e('Latest Posts', 'yatheme');
        }
    } elseif (is_archive()) {
        $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
        if ($term) {
            echo $term->name;
        } elseif (is_post_type_archive()) {
            echo get_queried_object()->labels->name;
        } elseif (is_day()) {
            printf(__('Daily Archives: %s', 'yatheme'), get_the_date());
        } elseif (is_month()) {
            printf(__('Monthly Archives: %s', 'yatheme'), get_the_date('F Y'));
        } elseif (is_year()) {
            printf(__('Yearly Archives: %s', 'yatheme'), get_the_date('Y'));
        } elseif (is_author()) {
            printf(__('Author Archives: %s', 'yatheme'), get_the_author());
        } else {
            single_cat_title();
        }
    } elseif (is_search()) {
        printf(__('Search Results for <small>%s</small>', 'yatheme'), get_search_query());
    } elseif (is_404()) {
        esc_html_e('Not Found', 'yatheme');
    } else {
        the_title();
    }
}
/**
 * Handle output of page title
 */
function boilerplate_title($post = null)
{
    $queried_object = get_queried_object();
    if (is_home()) {
        if (get_option('page_for_posts', true)) {
            return get_the_title(get_option('page_for_posts', true));
        } else {
            return __('Latest Posts', 'boilerplate');
        }
    } elseif (is_archive()) {
        $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
        if ($term && get_query_var('taxonomy') !== 'language') {
            return apply_filters('single_term_title', $term->name);
        } elseif (is_post_type_archive()) {
            return apply_filters('the_title', @$queried_object->labels->name ?: $queried_object->post_title);
        } elseif (is_day()) {
            return sprintf(__('Daily Archives: %s', 'boilerplate'), get_the_date());
        } elseif (is_month()) {
            return sprintf(__('Monthly Archives: %s', 'boilerplate'), get_the_date('F Y'));
        } elseif (is_year()) {
            return sprintf(__('Yearly Archives: %s', 'boilerplate'), get_the_date('Y'));
        } elseif (is_author()) {
            $author = $queried_object;
            return sprintf(__('Author Archives: %s', 'boilerplate'), apply_filters('the_author', is_object($author) ? $author->display_name : null));
        } else {
            return single_cat_title('', false);
        }
    } elseif (is_search()) {
        return sprintf(__('Search Results for &ldquo;%s&rdquo;', 'boilerplate'), get_search_query());
    } elseif (is_404()) {
        return __('Not Found', 'boilerplate');
    } else {
        return get_the_title();
    }
}
Esempio n. 11
0
 /**
  * You can use this to output a proper title for your page. This handles special cases such as archive page titles,
  * taxonomy archives, etc.
  *
  * @return string A nice page title
  */
 public static function mainPageTitle()
 {
     if (is_home()) {
         if (get_option('page_for_posts', true)) {
             return get_the_title(get_option('page_for_posts', true));
         } else {
             return __('Latest Posts', 'baobab');
         }
     } elseif (is_archive()) {
         $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
         if ($term) {
             return apply_filters('single_term_title', $term->name);
         } elseif (is_post_type_archive()) {
             return apply_filters('the_title', get_queried_object()->labels->name);
         } elseif (is_day()) {
             return sprintf(__('Daily Archives: %s', 'baobab'), get_the_date());
         } elseif (is_month()) {
             return sprintf(__('Monthly Archives: %s', 'baobab'), get_the_date('F Y'));
         } elseif (is_year()) {
             return sprintf(__('Yearly Archives: %s', 'baobab'), get_the_date('Y'));
         } elseif (is_author()) {
             $author = get_queried_object();
             return sprintf(__('Author Archives: %s', 'baobab'), apply_filters('the_author', is_object($author) ? $author->display_name : null));
         } else {
             return single_cat_title('', false);
         }
     } elseif (is_search()) {
         return sprintf(__('Search Results for %s', 'baobab'), get_search_query());
     } elseif (is_404()) {
         return __('Not Found', 'baobab');
     } else {
         return get_the_title();
     }
 }
Esempio n. 12
0
 function wpex_page_title($title = '')
 {
     global $post;
     // Homepage - display blog description if not a static page
     if (is_front_page() && !is_singular('page')) {
         $title = get_bloginfo('description');
         // Archives
     } elseif (is_archive()) {
         // Daily archive title
         if (is_day()) {
             $title = sprintf(__('Daily Archives: %s', 'wpex'), get_the_date());
             // Monthly archive title
         } elseif (is_month()) {
             $title = sprintf(__('Monthly Archives: %s', 'wpex'), get_the_date(_x('F Y', 'monthly archives date format', 'wpex')));
             // Yearly archive title
         } elseif (is_year()) {
             $title = sprintf(__('Yearly Archives: %s', 'wpex'), get_the_date(_x('Y', 'yearly archives date format', 'wpex')));
             // Standard term title
         } else {
             $title = single_term_title('', false);
         }
         // Search
     } elseif (is_search()) {
         global $wp_query;
         $title = '<span id="search-results-count">' . $wp_query->found_posts . '</span> ' . __('Search Results Found', 'wpex');
         // 404 Page
     } elseif (is_404()) {
         $title = __("404: Page Not Found", "wpex");
         // All else
     } else {
         $post_id = $post->ID;
         $title = get_the_title($post_id);
     }
     return $title;
 }
 function pesscore_config_get_utility_page_id()
 {
     $page_id = null;
     if (is_search()) {
         $page_id = of_get_option('template_page_id_search', null);
     } else {
         if (is_category()) {
             $page_id = of_get_option('template_page_id_blog_category', null);
         } else {
             if (is_tag()) {
                 $page_id = of_get_option('template_page_id_blog_tags', null);
             } else {
                 if (is_author()) {
                     $page_id = of_get_option('template_page_id_author', null);
                 } else {
                     if (is_date() || is_day() || is_month() || is_year()) {
                         $page_id = of_get_option('template_page_id_date', null);
                     } else {
                         if (is_tax('dt_portfolio_category')) {
                             $page_id = of_get_option('template_page_id_portfolio_category', null);
                         } else {
                             if (is_tax('dt_gallery_category')) {
                                 $page_id = of_get_option('template_page_id_gallery_category', null);
                             }
                         }
                     }
                 }
             }
         }
     }
     return apply_filters('pesscore_config_get_utility_page_id', $page_id);
 }
Esempio n. 14
0
/**
 * Page title used in the content area of each page. Note this is kinda legacy.
 * Could be replaced with wp_title().
 *
 * @package d7
 * @subpackage boilerplate-theme
 *
 * @return string The page title
 *
 */
function d7_get_page_title()
{
    $title = '';
    if (is_category()) {
        $title .= single_cat_title("", false);
    } elseif (is_tag()) {
        $title .= __('Content tagged: ', get_bloginfo('name')) . single_tag_title("", false);
    } elseif (is_day()) {
        $title .= __('Archive for ', get_bloginfo('name')) . get_the_time('F jS, Y');
    } elseif (is_month()) {
        $title .= __('Archive for', get_bloginfo('name')) . ' ' . get_the_time('F, Y');
    } elseif (is_year()) {
        $title .= __('Archive for', get_bloginfo('name')) . ' ' . get_the_time('Y');
    } elseif (is_search()) {
        $title .= __('Search results', get_bloginfo('name'));
        if (isset($_GET['s'])) {
            $title .= ' ' . __('for', get_bloginfo('name')) . ' <span class="search_term">&quot;' . $_GET['s'] . '&quot;</span>';
        }
    } elseif (is_author()) {
        $title .= __('Author archive', get_bloginfo('name'));
    } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
        $title .= __('Archives');
    } elseif (is_404()) {
        $title .= __('Oh darn!', get_bloginfo('name'));
    } else {
        $title .= bloginfo('name');
    }
    return $title;
}
Esempio n. 15
0
 /**
  * Display breadcrumbs
  */
 public function display()
 {
     if (Habakiri::get('is_displaying_bread_crumb') === 'false') {
         return;
     }
     global $wp_query;
     // Set to home
     $home_label = $this->get_home_label();
     $this->set($home_label, home_url('/'));
     // Set to blog
     $post_type = $this->get_post_type();
     if (is_category() || is_tag() || is_date() || is_author() || is_single() && $post_type === 'post') {
         $show_on_front = get_option('show_on_front');
         $page_for_posts = get_option('page_for_posts');
         if ($show_on_front === 'page' && $page_for_posts) {
             $this->set(get_the_title($page_for_posts), get_permalink($page_for_posts));
         }
     }
     // Set current and ancestors
     if (is_404()) {
         $this->set_for_404();
     } elseif (is_search()) {
         $this->set_for_search();
     } elseif (is_tax()) {
         $this->set_for_tax();
     } elseif (is_attachment()) {
         $this->set_for_attachment();
     } elseif (is_page() && !is_front_page()) {
         $this->set_for_page();
     } elseif (is_post_type_archive()) {
         $this->set_for_post_type_archive();
     } elseif (is_single()) {
         $this->set_for_single();
     } elseif (is_category()) {
         $this->set_for_category();
     } elseif (is_tag()) {
         $this->set_for_tag();
     } elseif (is_author()) {
         $this->set_for_author();
     } elseif (is_day()) {
         $this->set_for_day();
     } elseif (is_month()) {
         $this->set_for_month();
     } elseif (is_year()) {
         $this->set_for_year();
     } elseif (is_home() && !is_front_page()) {
         $this->set_for_blog();
     }
     $bread_crumb = array();
     $last_item = array_pop($this->bread_crumb);
     foreach ($this->bread_crumb as $_bread_crumb) {
         if (!empty($_bread_crumb['link'])) {
             $bread_crumb[] = sprintf('<a href="%s">%s</a>', esc_url($_bread_crumb['link']), esc_html($_bread_crumb['title']));
         } else {
             $bread_crumb[] = esc_html($_bread_crumb['title']);
         }
     }
     $bread_crumb[] = sprintf('<strong>%s</strong>', $last_item['title']);
     printf('<div class="breadcrumbs">%s</div>', implode(' &gt; ', apply_filters('habakiri_bread_crumb', $bread_crumb)));
 }
function teo_filter_wp_title($old_title, $sep, $sep_location)
{
    $ssep = ' ' . $sep . ' ';
    if (is_home()) {
        return get_bloginfo('name');
    } elseif (is_single() || is_page()) {
        return get_the_title();
    } elseif (is_category()) {
        $output = $ssep . 'Category';
    } elseif (is_tag()) {
        $output = $ssep . 'Tag';
    } elseif (is_author()) {
        $output = $ssep . 'Author';
    } elseif (is_year() || is_month() || is_day()) {
        $output = $ssep . 'Archives';
    } else {
        $output = NULL;
    }
    // get the page number we're on (index)
    if (get_query_var('paged')) {
        $num = $ssep . 'page ' . get_query_var('paged');
    } elseif (get_query_var('page')) {
        $num = $ssep . 'page ' . get_query_var('page');
    } else {
        $num = NULL;
    }
    // concoct and return new title
    return get_bloginfo('name') . $output . $old_title . $num;
}
Esempio n. 17
0
 function semifolio_filter_wp_title($old_title, $sep, $sep_location)
 {
     // add padding to the sep
     $ssep = ' ' . $sep . ' ';
     // find the type of index page this is
     if (is_category()) {
         $insert = $ssep . __('Category', 'slaves');
     } elseif (is_tag()) {
         $insert = $ssep . __('Tag', 'slaves');
     } elseif (is_author()) {
         $insert = $ssep . __('Author', 'slaves');
     } elseif (is_year() || is_month() || is_day()) {
         $insert = $ssep . __('Archives', 'slaves');
     } elseif (is_home()) {
         $insert = $ssep . bloginfo('description');
     } else {
         $insert = NULL;
     }
     // get the page number we're on (index)
     if (get_query_var('paged')) {
         $num = $ssep . __('Page ', 'slaves') . get_query_var('paged');
     } elseif (get_query_var('page')) {
         $num = $ssep . __('Page ', 'slaves') . get_query_var('page');
     } else {
         $num = NULL;
     }
     // concoct and return new title
     return bloginfo('name') . $insert . $old_title . $num;
 }
/**
 * Print breadcrumb trail
 *
 *
 */
function smartadapt_the_bredcrumb()
{
    //Get bredcrumb separator
    $sep = smartadapt_option('breadcrumb_separator') ? smartadapt_option('breadcrumb_separator') : ' &raquo; ';
    if (!is_front_page()) {
        echo '<a href="';
        echo home_url();
        echo '">';
        bloginfo('name');
        echo '</a>' . $sep;
        if (is_category() || is_single()) {
            the_category($sep);
        } elseif (is_archive() || is_single()) {
            if (is_day()) {
                printf(__('%s', 'smartadapt'), get_the_date());
            } elseif (is_month()) {
                printf(__('%s', 'smartadapt'), get_the_date(_x('F Y', 'monthly archives date format', 'smartadapt')));
            } elseif (is_year()) {
                printf(__('%s', 'smartadapt'), get_the_date(_x('Y', 'yearly archives date format', 'smartadapt')));
            } else {
                _e('Blog Archives', 'smartadapt');
            }
        }
        if (is_page()) {
            echo the_title();
        }
    }
}
Esempio n. 19
0
/**
 * Returns the document title.
 *
 * The order (site name first or last) can be set on the Tarski Options page.
 * While the function ultimately returns a string, please note that filters
 * are applied to an array! This allows plugins to easily alter any aspect
 * of the title. For example, one might write a plugin to change the separator.
 *
 * @since 1.5
 * @deprecated 3.2.0
 *
 * @param string $sep
 * @return string
 *
 * @hook filter tarski_doctitle
 * Filter document titles.
 */
function tarski_doctitle($sep = '&middot;')
{
    _deprecated_function('wp_title', '3.2.0');
    $site_name = get_bloginfo('name');
    $content = trim(wp_title('', false));
    if (is_404()) {
        $content = sprintf(__('Error %s', 'tarski'), '404');
    } elseif (get_option('show_on_front') == 'posts' && is_home()) {
        $content = get_bloginfo('description', 'display');
    } elseif (is_search()) {
        $content = sprintf(__('Search results for %s', 'tarski'), esc_html(get_search_query()));
    } elseif (is_month()) {
        $content = single_month_title(' ', false);
    } elseif (is_tag()) {
        $content = multiple_tag_titles();
    }
    $elements = strlen($content) > 0 ? array('site_name' => $site_name, 'separator' => $sep, 'content' => $content) : array('site_name' => $site_name);
    if (get_tarski_option('swap_title_order')) {
        $elements = array_reverse($elements, true);
    }
    // Filters should return an array
    $elements = apply_filters('tarski_doctitle', $elements);
    // But if they don't, it won't try to implode
    if (is_array($elements)) {
        $doctitle = implode(' ', $elements);
    }
    echo $doctitle;
}
 function mh_page_title()
 {
     if (is_home()) {
         echo get_the_title(get_option('page_for_posts', true));
     } elseif (is_author()) {
         global $author;
         $user_info = get_userdata($author);
         echo __('Articles by ', 'mh') . esc_attr($user_info->display_name);
     } elseif (is_category() || is_tax()) {
         echo single_cat_title("", false);
     } elseif (is_tag()) {
         echo single_tag_title("", false);
     } elseif (is_search()) {
         echo __('Search Results for ', 'mh') . get_search_query();
     } elseif (is_day()) {
         echo get_the_date();
     } elseif (is_month()) {
         echo get_the_date('F Y');
     } elseif (is_year()) {
         echo get_the_date('Y');
     } elseif (is_404()) {
         echo __('Page not found (404)', 'mh');
     } else {
         echo get_the_title();
     }
 }
Esempio n. 21
0
/**
 * Title filter 
 */
function mediamaven_filter_wp_title($old_title, $sep, $sep_location)
{
    $site_name = get_bloginfo('name');
    $site_description = get_bloginfo('description');
    // add padding to the sep
    $ssep = ' ' . $sep . ' ';
    if ($site_description && (is_home() || is_front_page())) {
        return $site_name . ' | ' . $site_description;
    } else {
        // find the type of index page this is
        if (is_category()) {
            $insert = $ssep . __('Kategorija', 'media-maven');
        } elseif (is_tag()) {
            $insert = $ssep . __('Žymos', 'media-maven');
        } elseif (is_author()) {
            $insert = $ssep . __('Autorius', 'media-maven');
        } elseif (is_year() || is_month() || is_day()) {
            $insert = $ssep . __('Archyvai', 'media-maven');
        } else {
            $insert = NULL;
        }
        // get the page number we're on (index)
        if (get_query_var('paged')) {
            $num = $ssep . __('Page ', 'media-maven') . get_query_var('paged');
        } elseif (get_query_var('page')) {
            $num = $ssep . __('Page ', 'media-maven') . get_query_var('page');
        } else {
            $num = NULL;
        }
        // concoct and return new title
        return $site_name . $insert . $old_title . $num;
    }
}
Esempio n. 22
0
function tf_get_title()
{
    if (is_archive()) {
        if (is_category()) {
            $page_title = __('Category Archives: ', THEME_SLUG);
            $page_description = sprintf('%s', single_cat_title('', false));
        } elseif (is_tag()) {
            $page_title = __('Tag Archives: ', THEME_SLUG);
            $page_description = sprintf('%s', single_tag_title('', false));
        } elseif (is_day()) {
            $page_title = __('Archives: ', THEME_SLUG);
            $page_description = sprintf('%s', get_the_time('F jS, Y'));
        } elseif (is_month()) {
            $page_title = __('Archives: ', THEME_SLUG);
            $page_description = sprintf('%s', get_the_time('F, Y'));
        } elseif (is_year()) {
            $page_title = __('Archives: ', THEME_SLUG);
            $page_description = sprintf('%s', get_the_time('Y'));
        }
    } elseif (is_404()) {
        $page_title = __('404 - Not Found', THEME_SLUG);
        $page_description = __('404 - Not Found', THEME_SLUG);
    } elseif (is_search()) {
        $page_title = __('Search results: ', THEME_SLUG);
        $page_description = sprintf('%s', stripslashes(strip_tags(get_search_query())));
    }
    //if(is_tax( 'portfolio_category' )) $page_title = sprintf('%s',single_cat_title('',false));
    echo '<h1>' . $page_title . '</h1><h2>' . $page_description . '</h2>';
}
Esempio n. 23
0
 public function getIndex(Request $request, $param1 = null, $param2 = null, $param3 = null, $param4 = null)
 {
     if (strtolower($param1) === 'generate') {
         return $this->getGenerate($request);
     } else {
         if (is_year($param1) && is_null($param2) && is_null($param3) && is_null($param4)) {
             return $this->makeMonthsView($request, $param1);
         } else {
             if (is_year($param1) && is_month($param2) && is_null($param3) && is_null($param4)) {
                 return $this->makeListView($request, $param1, $param2, $param3);
             } else {
                 if (is_year($param1) && is_month($param2) && !is_null($param3) && is_null($param4)) {
                     if (is_day($param3)) {
                         return $this->makeDayView($request, $param1, $param2, $param3);
                     } else {
                         if (is_uuid($param3)) {
                             return $this->makeMonthEmployeeView($request, $param1, $param2, $param3);
                         } else {
                             return redirect('/dtr/' . now('year'));
                         }
                     }
                 } else {
                     if (is_year($param1) && is_month($param2) && is_day($param3)) {
                         return $this->makeDayEmployeeView($request, $param1, $param2, $param3, $param4);
                     } else {
                         return redirect('/dtr/' . now('year'));
                     }
                 }
             }
         }
     }
     //.'/'.now('month'));//return $this->makeListView($request, $param1, $param2, $param3);
 }
Esempio n. 24
0
function quindo_get_alm_options_front($offset)
{
    $alm_options = quindo_get_alm_options();
    if ($offset) {
        $alm_options['offset'] = $offset;
    }
    if (is_category()) {
        $alm_options['category'] = get_category(get_query_var('cat'))->slug;
    }
    if (is_year() || is_month() || is_day()) {
        $alm_options['year'] = get_the_time('Y');
    }
    if (is_month() || is_day()) {
        $alm_options['month'] = get_the_time('n');
    }
    if (is_day()) {
        $alm_options['day'] = get_the_time('j');
    }
    if (is_author()) {
        $alm_options['author'] = get_user_by('slug', get_query_var('author_name'))->ID;
    }
    if (is_search()) {
        $alm_options['search'] = get_query_var('s');
    }
    $alm_options_imploded = '';
    foreach ($alm_options as $option => $value) {
        $alm_options_imploded .= ' ' . $option . '="' . $value . '"';
    }
    return $alm_options_imploded;
}
Esempio n. 25
0
function featureText()
{
    if (is_front_page()) {
        the_field('feature_text');
    } elseif (is_home() || is_single()) {
        _e('Rock Theme Official Blog');
    } elseif (is_archive()) {
        _e('Rock Theme Official Blog');
        _e('<br>');
        single_term_title('Browsing: ');
        if (is_month()) {
            $monthNum = get_query_var('monthnum');
            $month = date('F', mktime(0, 0, 0, $monthNum));
            $year = get_query_var('year');
            echo 'Posts from ' . $month . ' ' . $year;
        }
    } elseif (is_page_template('page-news.php') || is_page_template('page-about.php') || is_page_template('page-contact.php')) {
        bloginfo('name');
        _e('<br>');
        the_title();
    } elseif (is_404()) {
        _e('Whoops, were a little lost.');
    } elseif (is_search()) {
        _e('Rock Theme Official Blog');
        _e('<br>');
        printf('Search results for: %s', get_search_query());
    }
}
function custom_intro()
{
    echo "<div class='intro'>";
    if (is_front_page()) {
        if (get_header_image()) {
            echo '<img class="header-image" src="' . esc_url(get_header_image()) . '" alt="' . get_bloginfo('description') . '" />';
        }
    } else {
        // get title
        $id = get_option('page_for_posts');
        if (is_day() || is_month() || is_year() || is_tag() || is_category() || is_singular('post') || is_home()) {
            $the_title = get_the_title($id);
        } else {
            $the_title = get_the_title();
        }
        if (is_home() || is_singular('post')) {
            if (has_post_thumbnail($id)) {
                echo get_the_post_thumbnail($id, 'full');
            } elseif (get_header_image()) {
                echo '<img class="header-image" src="' . esc_url(get_header_image()) . '" alt="' . $the_title . '" />';
            }
        } elseif (has_post_thumbnail() && is_singular('page')) {
            the_post_thumbnail();
        } elseif (get_header_image()) {
            echo '<img class="header-image" src="' . esc_url(get_header_image()) . '" alt="' . $the_title . '" />';
        }
    }
    echo "</div>";
}
/**
 * Overrides WP's default template for date-based archives. Better abstraction of templates than 
 * is_date() allows by checking for the year, month, week, day, hour, and minute.
 *
 * @since 0.6.0
 * @uses locate_template() Checks for template in child and parent theme.
 * @param string $template
 * @return string $template Full path to file.
 */
function hybrid_date_template($template)
{
    $templates = array();
    /* If viewing a time-based archive. */
    if (is_time()) {
        /* If viewing a minutely archive. */
        if (get_query_var('minute')) {
            $templates[] = 'minute.php';
        } elseif (get_query_var('hour')) {
            $templates[] = 'hour.php';
        }
        /* Catchall for any time-based archive. */
        $templates[] = 'time.php';
    } elseif (is_day()) {
        $templates[] = 'day.php';
    } elseif (get_query_var('w')) {
        $templates[] = 'week.php';
    } elseif (is_month()) {
        $templates[] = 'month.php';
    } elseif (is_year()) {
        $templates[] = 'year.php';
    }
    /* Catchall template for date-based archives. */
    $templates[] = 'date.php';
    /* Fall back to the basic archive template. */
    $templates[] = 'archive.php';
    /* Return the found template. */
    return locate_template($templates);
}
Esempio n. 28
0
function get_index_headline()
{
    if (is_home()) {
        $index_headline = 'Blog Index';
    } else {
        if (is_category()) {
            $category = single_term_title("", false);
            $index_headline = 'Archives for the "' . $category . '" Category';
        } elseif (is_tag()) {
            $tag = single_term_title("", false);
            $index_headline = 'Archives for the "' . $tag . '" Category';
        } elseif (is_day()) {
            $index_headline = 'Archive for ' . get_the_time('F jS, Y');
        } elseif (is_month()) {
            $index_headline = 'Archive for ' . get_the_time('F Y');
        } elseif (is_year()) {
            $index_headline = 'Archive for ' . get_the_time('Y');
        } elseif (is_author()) {
            $index_headline = 'Author Archive';
        } else {
            $index_headline = 'Blog Archives';
        }
    }
    return $index_headline;
}
Esempio n. 29
0
function porto_page_title()
{
    global $porto_settings;
    $output = '';
    if (!is_front_page()) {
    } elseif (is_home()) {
        $output .= $porto_settings['blog-title'];
    }
    if (is_singular()) {
        $output .= porto_page_title_leaf();
    } else {
        if (is_post_type_archive()) {
            if (is_search()) {
                $output .= porto_page_title_leaf('search');
            } else {
                $output .= porto_page_title_archive();
            }
        } elseif (is_tax() || is_tag() || is_category()) {
            $html = porto_page_title_leaf('term');
            if (is_tag()) {
                $output .= sprintf(__('Tag - %s', 'porto'), $html);
            } elseif (is_tax('product_tag')) {
                $output .= sprintf(__('Product Tag - %s', 'porto'), $html);
            } else {
                $output .= $html;
            }
        } elseif (is_date()) {
            if (is_year()) {
                $output .= porto_page_title_leaf('year');
            } elseif (is_month()) {
                $output .= porto_page_title_leaf('month');
            } elseif (is_day()) {
                $output .= porto_page_title_leaf('day');
            }
        } elseif (is_author()) {
            $output .= porto_page_title_leaf('author');
        } elseif (is_search()) {
            $output .= porto_page_title_leaf('search');
        } elseif (is_404()) {
            $output .= porto_page_title_leaf('404');
        } elseif (class_exists('bbPress') && is_bbpress()) {
            if (bbp_is_search()) {
                $output .= porto_page_title_leaf('bbpress_search');
            } elseif (bbp_is_single_user()) {
                $output .= porto_page_title_leaf('bbpress_user');
            } else {
                $output .= porto_page_title_leaf();
            }
        } else {
            if (is_home() && !is_front_page()) {
                if (get_option('show_on_front') == 'page') {
                    $output .= get_the_title(get_option('page_for_posts', true));
                } else {
                    $output .= $porto_settings['blog-title'];
                }
            }
        }
    }
    return apply_filters('porto_page_title', $output);
}
Esempio n. 30
0
/**
 * Output description
 *
 * @return string $description
 */
function calibrefx_meta_description()
{
    global $post, $wp_query, $wp_locale;
    $desc = '';
    if (is_home() || is_front_page()) {
        $desc = get_bloginfo('description');
    } elseif (is_singular()) {
        $desc = calibrefx_truncate_phrase($post->post_content, calibrefx_get_option('content_archive_limit'));
    } elseif (is_archive()) {
        if (is_category()) {
            $desc = category_description(get_query_var('cat'));
        } elseif (is_tax()) {
            $term = $wp_query->get_queried_object();
            $desc = term_description($term->term_id, $term->taxonomy);
        } elseif (is_year()) {
            $desc = __('All posts in ', 'calibrefx') . get_query_var('year');
        } elseif (is_month()) {
            $desc = __('All Posts in ', 'calibrefx') . $wp_locale->get_month(get_query_var('monthnum')) . ' ' . get_query_var('year');
        } elseif (is_day()) {
            $desc = __('All Posts in ', 'calibrefx') . get_query_var('day') . ' ' . $wp_locale->get_month(get_query_var('monthnum')) . ' ' . get_query_var('year');
        } elseif (is_author()) {
            $desc = get_user_meta($wp_query->queried_object->ID, 'intro_text', true);
        } elseif (is_post_type_archive()) {
            $post_type = $wp_query->get_queried_object();
            $desc = $post_type->description;
        }
    } elseif (is_404()) {
        $desc = __('Page not found ', 'calibrefx');
    }
    $desc = str_replace(array('<p>', '</p>'), array('', ''), $desc);
    $desc = htmlentities($desc);
    return apply_filters('calibrefx_meta_description', $desc);
}