本文整理汇总了PHP中is_year函数的典型用法代码示例。如果您正苦于以下问题:PHP is_year函数的具体用法?PHP is_year怎么用?PHP is_year使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_year函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: presscore_search_title_shortcode
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;
}
开发者ID:RDePoppe,项目名称:luminaterealestate,代码行数:35,代码来源:shortcode-search-title.php
示例2: calibrefx_meta_description
/**
* 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);
}
开发者ID:alispx,项目名称:calibrefx,代码行数:38,代码来源:meta-helper.php
示例3: stachestack_title
/**
* 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);
}
开发者ID:BeardandFedora,项目名称:StacheStack,代码行数:37,代码来源:titles.php
示例4: family_banner
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
}
开发者ID:jun200,项目名称:wordpress,代码行数:32,代码来源:functions.php
示例5: getIndex
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);
}
开发者ID:jrsalunga,项目名称:gi-manager,代码行数:33,代码来源:DtrController.php
示例6: pinnacle_title
/**
* 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();
}
}
开发者ID:aliaspseudonym,项目名称:MoonCatCreations,代码行数:36,代码来源:utils.php
示例7: semifolio_filter_wp_title
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;
}
开发者ID:jokoprastiyo,项目名称:slaves-0.3,代码行数:29,代码来源:extras.php
示例8: mainPageTitle
/**
* 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();
}
}
开发者ID:marvinlabs,项目名称:baobab,代码行数:40,代码来源:Posts.php
示例9: warrior_archive_title
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;
}
开发者ID:TakenCdosG,项目名称:chefs_blog,代码行数:34,代码来源:theme-functions.php
示例10: wpex_page_title
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;
}
开发者ID:nhatnam1102,项目名称:wp-content,代码行数:35,代码来源:page-header.php
示例11: boilerplate_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 “%s”', 'boilerplate'), get_search_query());
} elseif (is_404()) {
return __('Not Found', 'boilerplate');
} else {
return get_the_title();
}
}
开发者ID:locomotivemtl,项目名称:wordpress-boilerplate,代码行数:38,代码来源:titles.php
示例12: pesscore_config_get_utility_page_id
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);
}
开发者ID:RDePoppe,项目名称:luminaterealestate,代码行数:32,代码来源:mod-archives-templates.php
示例13: d7_get_page_title
/**
* 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">"' . $_GET['s'] . '"</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;
}
开发者ID:nathansh,项目名称:nathansh.com-theme,代码行数:39,代码来源:page_title.php
示例14: dez_mp_theme_wp_title
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 = '»';
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;
}
开发者ID:jun200,项目名称:wordpress,代码行数:32,代码来源:theme-functions.php
示例15: get_index_headline
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;
}
开发者ID:jordanmaslyn,项目名称:vvv-starter,代码行数:25,代码来源:blog.php
示例16: ya_title
/**
* 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();
}
}
开发者ID:junibrosas,项目名称:shoppingyourway,代码行数:36,代码来源:utils.php
示例17: display
/**
* 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(' > ', apply_filters('habakiri_bread_crumb', $bread_crumb)));
}
开发者ID:ConductiveIO,项目名称:mbrady,代码行数:63,代码来源:class.breadcrumbs.php
示例18: teo_filter_wp_title
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;
}
开发者ID:xiguawanous-friends,项目名称:dazhe-temporary,代码行数:29,代码来源:custom-functions.php
示例19: dw_timeline_title
/**
* 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();
}
}
开发者ID:wenqingyu,项目名称:timeline-post,代码行数:37,代码来源:titles.php
示例20: smartadapt_the_bredcrumb
/**
* Print breadcrumb trail
*
*
*/
function smartadapt_the_bredcrumb()
{
//Get bredcrumb separator
$sep = smartadapt_option('breadcrumb_separator') ? smartadapt_option('breadcrumb_separator') : ' » ';
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();
}
}
}
开发者ID:haazenpfeffer,项目名称:haazenpfeffer,代码行数:33,代码来源:template-tags.php
注:本文中的is_year函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论