当前位置: 首页>>代码示例>>PHP>>正文


PHP is_month函数代码示例

本文整理汇总了PHP中is_month函数的典型用法代码示例。如果您正苦于以下问题:PHP is_month函数的具体用法?PHP is_month怎么用?PHP is_month使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了is_month函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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 = '&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;
 }
开发者ID:jun200,项目名称:wordpress,代码行数:32,代码来源:theme-functions.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: roots_title

/**
 * 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();
    }
}
开发者ID:luzmcosta,项目名称:theuglyvolvo,代码行数:37,代码来源:titles.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: 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

示例8: 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

示例9: 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

示例10: 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 &ldquo;%s&rdquo;', 'boilerplate'), get_search_query());
    } elseif (is_404()) {
        return __('Not Found', 'boilerplate');
    } else {
        return get_the_title();
    }
}
开发者ID:locomotivemtl,项目名称:wordpress-boilerplate,代码行数:38,代码来源:titles.php

示例11: 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

示例12: 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

示例13: 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

示例14: 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">&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;
}
开发者ID:nathansh,项目名称:nathansh.com-theme,代码行数:39,代码来源:page_title.php

示例15: 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(' &gt; ', apply_filters('habakiri_bread_crumb', $bread_crumb)));
 }
开发者ID:ConductiveIO,项目名称:mbrady,代码行数:63,代码来源:class.breadcrumbs.php


注:本文中的is_month函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。