本文整理汇总了PHP中tag_description函数的典型用法代码示例。如果您正苦于以下问题:PHP tag_description函数的具体用法?PHP tag_description怎么用?PHP tag_description使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tag_description函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: webdados_fb_open_graph
//.........这里部分代码省略.........
$fb_author_show_meta = 0;
$fb_author_show_linkrelgp = 0;
$fb_author_show_twitter = 0;
switch (trim($fb_desc_homepage)) {
case 'custom':
$fb_desc = esc_attr(strip_tags(stripslashes($fb_desc_homepage_customtext)));
//WPML?
if (function_exists('icl_object_id') && function_exists('icl_register_string')) {
global $sitepress;
if (ICL_LANGUAGE_CODE != $sitepress->get_default_language()) {
$fb_desc = icl_t('wd-fb-og', 'wd_fb_og_desc_homepage_customtext', $fb_desc);
} else {
//We got it already
}
}
break;
default:
$fb_desc = esc_attr(strip_tags(stripslashes(get_bloginfo('description'))));
break;
}
if (is_category()) {
$fb_title = esc_attr(strip_tags(stripslashes(single_cat_title('', false))));
$term = $wp_query->get_queried_object();
$fb_url = get_term_link($term, $term->taxonomy);
$cat_desc = trim(esc_attr(strip_tags(stripslashes(category_description()))));
if (trim($cat_desc) != '') {
$fb_desc = $cat_desc;
}
} else {
if (is_tag()) {
$fb_title = esc_attr(strip_tags(stripslashes(single_tag_title('', false))));
$term = $wp_query->get_queried_object();
$fb_url = get_term_link($term, $term->taxonomy);
$tag_desc = trim(esc_attr(strip_tags(stripslashes(tag_description()))));
if (trim($tag_desc) != '') {
$fb_desc = $tag_desc;
}
} else {
if (is_tax()) {
$fb_title = esc_attr(strip_tags(stripslashes(single_term_title('', false))));
$term = $wp_query->get_queried_object();
$fb_url = get_term_link($term, $term->taxonomy);
//WooCommerce
if (intval($fb_image_show) == 1 || intval($fb_image_show_schema) == 1 || intval($fb_image_show_twitter) == 1) {
if (class_exists('woocommerce') && $fb_wc_usecategthumb == 1 && is_product_category()) {
if ($thumbnail_id = get_woocommerce_term_meta($term->term_id, 'thumbnail_id', true)) {
if ($image = wp_get_attachment_url($thumbnail_id)) {
$fb_image = $image;
}
}
}
}
} else {
if (is_search()) {
$fb_title = esc_attr(strip_tags(stripslashes(__('Search for') . ' "' . get_search_query() . '"')));
$fb_url = get_search_link();
} else {
if (is_author()) {
$fb_title = esc_attr(strip_tags(stripslashes(get_the_author_meta('display_name', get_query_var('author')))));
$fb_url = get_author_posts_url(get_query_var('author'), get_query_var('author_name'));
} else {
if (is_archive()) {
if (is_day()) {
$fb_title = esc_attr(strip_tags(stripslashes(get_query_var('day') . ' ' . single_month_title(' ', false) . ' ' . __('Archives'))));
$fb_url = get_day_link(get_query_var('year'), get_query_var('monthnum'), get_query_var('day'));
} else {
示例2: description
function description()
{
if (is_home() || is_front_page()) {
echo trim(of_get_option('site_description'));
} elseif (is_category()) {
$description = strip_tags(category_description());
echo trim($description);
} elseif (is_single()) {
if (get_the_excerpt()) {
echo get_the_excerpt();
} else {
global $post;
$description = trim(str_replace(array("\r\n", "\r", "\n", " ", " "), " ", str_replace("\"", "'", strip_tags($post->post_content))));
echo mb_substr($description, 0, 220, 'utf-8');
}
} elseif (is_search()) {
echo '“';
the_search_query();
echo '”为您找到结果 ';
global $wp_query;
echo $wp_query->found_posts;
echo ' 个';
} elseif (is_tag()) {
$description = strip_tags(tag_description());
echo trim($description);
} else {
$description = strip_tags(term_description());
echo trim($description);
}
}
示例3: get_desc
function get_desc()
{
if (is_404()) {
$desc = __("Sorry, but the page you were trying to view does not exist. \n\nIt looks like this was the result of either a mistyped address or an out-of-date link.", 'skrollr');
} else {
if (is_category()) {
$desc = category_description();
} else {
if (is_tag()) {
$desc = tag_description();
} else {
if (is_search()) {
global $wp_query;
if ($wp_query->found_posts == 0) {
$desc = __('Nothing found', 'skrollr');
} else {
$desc = sprintf(_n('One post found.', '%d posts found', $wp_query->found_posts, 'skrollr'), $wp_query->found_posts);
}
} else {
$desc = get_theme_mod('metadesc');
}
}
}
}
return wpautop(esc_html($desc));
}
示例4: lo_description
function lo_description()
{
global $s, $post;
$description = '';
$blog_name = get_bloginfo('name');
if (is_singular()) {
$ID = $post->ID;
$title = $post->post_title;
$author = $post->post_author;
$user_info = get_userdata($author);
$post_author = $user_info->display_name;
if (!get_post_meta($ID, "meta-description", true)) {
$description = $title . ' - 作者: ' . $post_author . ',首发于' . $blog_name;
} else {
$description = get_post_meta($ID, "meta-description", true);
}
} elseif (is_home()) {
$description = lo_opt('index_description');
} elseif (is_tag()) {
$description = single_tag_title('', false) . " - " . trim(strip_tags(tag_description()));
} elseif (is_category()) {
$description = single_cat_title('', false) . " - " . trim(strip_tags(category_description()));
} elseif (is_archive()) {
$description = $blog_name . "'" . trim(wp_title('', false)) . "'";
} elseif (is_search()) {
$description = $blog_name . ": '" . esc_html($s, 1) . "' 的搜索結果";
} else {
$description = $blog_name . "'" . trim(wp_title('', false)) . "'";
}
$description = mb_substr($description, 0, 220, 'utf-8');
echo "<meta name=\"description\" content=\"{$description}\">\n";
}
示例5: gabfire_catNameDesc
function gabfire_catNameDesc()
{
if (is_category()) {
?>
<section class="row">
<div class="col-md-12">
<div class="post-lead">
<?php
if (is_category()) {
?>
<h1><?php
single_cat_title();
?>
</h1>
<?php
echo category_description();
?>
<?php
} else {
?>
<h1 class="post-title"><?php
single_tag_title();
?>
</h1>
<?php
echo tag_description();
?>
<?php
}
?>
</div>
</div>
</section><?php
} elseif (is_search()) {
?>
<section class="row archive">
<div class="col-md-12">
<div class="post-lead">
<h1><i class='fa fa-search'></i> <?php
echo get_search_query();
?>
</h1>
<?php
$search_query = get_search_query();
?>
<p><?php
printf(esc_attr__('Search results for %1$s', 'gabfire'), $search_query);
?>
</p>
</div>
</div>
</section><?php
}
}
示例6: rolo_pageheader
/**
* Shows appropriate title for each page
*
* @since 1.2
*/
function rolo_pageheader()
{
if (is_single()) {
$pagetitle = '<h2 class="page-title">' . __(get_the_term_list($post->ID, 'type', ' ', ', ', ': '), 'rolopress') . __(get_the_title(), 'rolopress') . "</h2>\n";
} elseif (is_page()) {
$pagetitle = '<h2 class="page-title page">' . __(get_the_title(), 'rolopress') . "</h2>\n";
} elseif (is_404()) {
$pagetitle = '<h2 class="page-title 404">' . __('Not Found', 'rolopress') . "</h2>\n";
} elseif (is_home()) {
$pagetitle = '<h2 class="page-title home">' . __('All Items', 'rolopress') . "</h2>\n";
} elseif (is_search()) {
$pagetitle = '<h2 class="page-title search">' . __('Search Results for: ', 'rolopress') . '"' . get_search_query() . '"' . "</h2>\n";
} elseif (is_category()) {
$current_category = single_cat_title("", false);
$pagedesc = category_description();
$pagetitle = '<h2 class="page-title category">' . __('Items Categorized As: ', 'rolopress') . '"' . $current_category . '"' . "</h2>\n";
} elseif (is_tag()) {
$current_tag = single_tag_title("", false);
$pagedesc = tag_description();
$pagetitle = '<h2 class="page-title tag">' . __('Items Tagged As: ', 'rolopress') . '"' . $current_tag . '"' . "</h2>\n";
} elseif (is_tax()) {
global $term;
$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
$pagedesc = $term->description;
$pagetitle = '<h2 class="page-title taxonomy">' . __($term->name, 'rolopress') . __(' List', 'rolopress') . "</h2>\n";
} elseif (is_author()) {
global $wp_query;
$curauth = $wp_query->get_queried_object();
// get the authors name
$pagetitle = '<h2 class="page-title author">' . __('Owned by: ', 'rolopress') . $curauth->display_name . "</h2>\n";
} elseif (is_archive()) {
if (is_day()) {
$pagetitle = '<h2 class="page-title day">' . __('Items Created On: ', 'rolopress') . get_the_time(get_option('date_format')) . "</h2>\n";
} elseif (is_month()) {
$pagetitle = '<h2 class="page-title month">' . __('Items Created In: ', 'rolopress') . get_the_time('F Y') . "</h2>\n";
} elseif (is_year()) {
$pagetitle = '<h2 class="page-title year">' . __('Items Created In: ', 'rolopress') . get_the_time('Y') . "</h2>\n";
}
} else {
$pagetitle = '<h2 class="page-title page">' . __(get_the_title(), 'rolopress') . "</h2>\n";
}
// show the page title
echo $pagetitle;
// show a description if set
if (!empty($pagedesc)) {
echo '<div class="archive-meta">' . $pagedesc . '</div>';
}
}
示例7: mytheme_description
function mytheme_description()
{
global $post;
if (is_front_page()) {
$description = get_bloginfo('description');
} elseif (is_archive()) {
$description = category_description();
} elseif (is_tag()) {
$description = tag_description();
} else {
setup_postdata($post);
$content = get_the_excerpt();
$author = get_userdata($post->post_author)->user_nicename;
$description = htmlspecialchars($content);
}
echo '<meta name="description" content="' . strip_tags($description) . '">' . "\n";
}
示例8: single_tag_title
<div class="post_nav">
<div class="blog_desc">
<h2>Dilettante</h2>
<p>„Dilettante – teatr w ruchu” to działania Małopolskiego Instytutu Kultury, których celem jest wspieranie amatorskiego ruchu teatralnego. Wsparcie to polega na szkoleniu i podnoszeniu kompetencji animatorów grup teatralnych w ramach warsztatów z pedagogiki teatru, prowadzonych przez aktorów, pedagogów, teatrologów, a także na udostępnianiu materiałów dydaktycznych, udzielaniu konsultacji oraz informowaniu o wydarzeniach teatralnych w regionie.</p>
</div>
<div style="margin:1em 0;">
<span class="spacer">Gdzie jestem? </span><span>Przeglądasz archiwa oznaczone tagiem </span><span class="spacer2"> <?php
single_tag_title();
?>
</span>
</div>
<p><?php
echo tag_description($tag_id);
?>
</p>
<h2 class="widgettitle">Tagi</h2>
<ul>
<li><?php
wp_tag_cloud('smallest=8&largest=16');
?>
</li>
</ul>
</div>
<?php
} elseif (is_month()) {
?>
<div class="post_nav">
<div style="margin:1em 0;">
示例9: get_content_part
function get_content_part()
{
global $post;
?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php
/* Start the Loop */
$page_on_front = get_option('page_on_front');
$page_for_posts = get_option('page_for_posts');
if (is_page() && !empty($page_on_front) && !empty($page_for_posts) && $page_on_front == $page_for_posts) {
echo '<div class="alert alert-danger"><strong>' . __("Front page displays Error.", 'fruitful') . '</strong> ' . __('Select different pages!', 'fruitful') . '</div>';
} else {
if (!is_archive() && !is_search() && !is_404()) {
if (is_home()) {
if (have_posts()) {
/* The loop */
while (have_posts()) {
the_post();
do_action('before_post_content_loop');
get_template_part('content', get_post_format());
do_action('after_post_content_loop');
}
fruitful_content_nav('nav-below');
} else {
get_template_part('no-results', 'index');
}
} else {
if (have_posts()) {
while (have_posts()) {
the_post();
if (is_page() && !is_front_page() && !is_home()) {
get_template_part('content', 'page');
if (fruitful_state_page_comment()) {
comments_template('', true);
}
} else {
if (is_single()) {
get_template_part('content', get_post_format());
fruitful_content_nav('nav-below');
if (fruitful_state_post_comment()) {
if (comments_open() || '0' != get_comments_number()) {
comments_template();
}
}
} else {
if (is_front_page()) {
get_template_part('content', 'page');
}
}
}
}
}
}
} else {
?>
<section id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php
if (have_posts()) {
?>
<header class="page-header">
<h1 class="page-title">
<?php
if (is_archive()) {
if (is_category()) {
printf(__('Category Archives: %s', 'fruitful'), '<span>' . single_cat_title('', false) . '</span>');
} elseif (is_tag()) {
printf(__('Tag Archives: %s', 'fruitful'), '<span>' . single_tag_title('', false) . '</span>');
} elseif (is_author()) {
the_post();
printf(__('Author Archives: %s', 'fruitful'), '<span class="vcard"><a class="url fn n" href="' . get_author_posts_url(get_the_author_meta("ID")) . '" title="' . esc_attr(get_the_author()) . '" rel="me">' . get_the_author() . '</a></span>');
rewind_posts();
} elseif (is_day()) {
printf(__('Daily Archives: %s', 'fruitful'), '<span>' . get_the_date() . '</span>');
} elseif (is_month()) {
printf(__('Monthly Archives: %s', 'fruitful'), '<span>' . get_the_date('F Y') . '</span>');
} elseif (is_year()) {
printf(__('Yearly Archives: %s', 'fruitful'), '<span>' . get_the_date('Y') . '</span>');
} else {
_e('Archives', 'fruitful');
}
}
if (is_search()) {
printf(__('Search Results for: %s', 'fruitful'), '<span>' . get_search_query() . '</span>');
}
?>
</h1>
<?php
if (is_category()) {
$category_description = category_description();
if (!empty($category_description)) {
echo apply_filters('category_archive_meta', '<div class="taxonomy-description">' . $category_description . '</div>');
}
} elseif (is_tag()) {
$tag_description = tag_description();
if (!empty($tag_description)) {
echo apply_filters('tag_archive_meta', '<div class="taxonomy-description">' . $tag_description . '</div>');
}
//.........这里部分代码省略.........
示例10: printf
<?php
if (have_posts()) {
?>
<header class="archive-header">
<h1 class="archive-title"><?php
printf(__('Tag Archives: %s', 'wpforge'), '<span>' . single_tag_title('', false) . '</span>');
?>
</h1>
<?php
if (tag_description()) {
// Show an optional tag description
?>
<div class="archive-meta"><?php
echo tag_description();
?>
</div>
<?php
}
?>
</header><!-- .archive-header -->
<?php
/* Start the Loop */
while (have_posts()) {
the_post();
/* Include the post format-specific template for the content. If you want to
* this in a child theme then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
示例11: get_header
get_header(); ?>
<section id="primary" class="span8">
<?php tha_content_before(); ?>
<div id="content" role="main">
<?php tha_content_top();
if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title"><?php
printf( __( 'Tag Archives: %s', 'the-bootstrap' ), '<span>' . single_tag_title( '', false ) . '</span>' );
?></h1>
<?php if ( $tag_description = tag_description() ) {
echo apply_filters( 'tag_archive_meta', '<div class="tag-archive-meta">' . $tag_description . '</div>' );
} ?>
</header><!-- .page-header -->
<?php
while ( have_posts() ) {
the_post();
get_template_part( '/partials/content', get_post_format() );
}
the_bootstrap_content_nav();
else :
get_template_part( '/partials/content', 'not-found' );
endif;
tha_content_bottom(); ?>
示例12: yit_get_option
*
* This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://www.gnu.org/licenses/gpl-3.0.txt
*/
global $wp_query, $post, $more;
$blog_type = yit_get_option('blog-type');
if (is_single()) {
$blog_type = 'big';
}
if (is_category() || is_tag()) {
if (is_category()) {
echo do_shortcode(category_description());
} elseif (is_tag()) {
echo do_shortcode(tag_description());
}
echo '<div class="clear"></div>';
}
if (have_posts()) {
if (is_category()) {
if (yit_get_option('show-title-categories')) {
?>
<h3><?php
echo apply_filters('yit_archive_category_title', sprintf(yit_get_option('page-categories-title'), single_cat_title('', false)));
?>
</h3>
<?php
}
?>
示例13: printf
</ul>
</div>
<h4>浏览<?php
// If this is a category archive
if (is_category()) {
printf('分类</h4>
<h2>' . single_cat_title('', false) . '</h2>');
if (category_description()) {
echo '<p>' . category_description() . '</p>';
}
// If this is a tag archive
} elseif (is_tag()) {
printf('标签</h4>
<h2>' . single_tag_title('', false) . '</h2>');
if (tag_description()) {
echo '<p>' . tag_description() . '</p>';
}
// If this is a daily archive
} elseif (is_day()) {
printf('日期存档</h4>
<h2>' . get_the_time('Y年n月j日') . '</h2>');
// If this is a monthly archive
} elseif (is_month()) {
printf('月份存档</h4>
<h2>' . get_the_time('Y年n月') . '</h2>');
// If this is a yearly archive
} elseif (is_year()) {
printf('年份存档</h4>
<h2>' . get_the_time('Y年') . '</h2>');
// If this is an author archive
} elseif (is_author()) {
示例14: amt_add_basic_metadata_head
//.........这里部分代码省略.........
if (!empty($full_metatags_for_content)) {
$metadata_arr[] = html_entity_decode(stripslashes($full_metatags_for_content));
}
// Category based archives
} elseif (is_category()) {
if ($do_description) {
// If set, the description of the category is used in the 'description' metatag.
// Otherwise, a generic description is used.
// Here we sanitize the provided description for safety
$description_content = sanitize_text_field(amt_sanitize_description(category_description()));
// Note: Contains multipage information through amt_process_paged()
if (empty($description_content)) {
// Add a filtered generic description.
$generic_description = apply_filters('amt_generic_description_category_archive', __('Content filed under the %s category.', 'add-meta-tags'));
$generic_description = sprintf($generic_description, single_cat_title($prefix = '', $display = false));
$metadata_arr[] = '<meta name="description" content="' . esc_attr(amt_process_paged($generic_description)) . '" />';
} else {
$metadata_arr[] = '<meta name="description" content="' . esc_attr(amt_process_paged($description_content)) . '" />';
}
}
if ($do_keywords) {
// The category name alone is included in the 'keywords' metatag
// Here we sanitize the provided keywords for safety
$cur_cat_name = sanitize_text_field(amt_sanitize_keywords(single_cat_title($prefix = '', $display = false)));
if (!empty($cur_cat_name)) {
$metadata_arr[] = '<meta name="keywords" content="' . esc_attr($cur_cat_name) . '" />';
}
}
} elseif (is_tag()) {
if ($do_description) {
// If set, the description of the tag is used in the 'description' metatag.
// Otherwise, a generic description is used.
// Here we sanitize the provided description for safety
$description_content = sanitize_text_field(amt_sanitize_description(tag_description()));
// Note: Contains multipage information through amt_process_paged()
if (empty($description_content)) {
// Add a filtered generic description.
$generic_description = apply_filters('amt_generic_description_tag_archive', __('Content tagged with %s.', 'add-meta-tags'));
$generic_description = sprintf($generic_description, single_tag_title($prefix = '', $display = false));
$metadata_arr[] = '<meta name="description" content="' . esc_attr(amt_process_paged($generic_description)) . '" />';
} else {
$metadata_arr[] = '<meta name="description" content="' . esc_attr(amt_process_paged($description_content)) . '" />';
}
}
if ($do_keywords) {
// The tag name alone is included in the 'keywords' metatag
// Here we sanitize the provided keywords for safety
$cur_tag_name = sanitize_text_field(amt_sanitize_keywords(single_tag_title($prefix = '', $display = false)));
if (!empty($cur_tag_name)) {
$metadata_arr[] = '<meta name="keywords" content="' . esc_attr($cur_tag_name) . '" />';
}
}
// Custom taxonomies - Should be after is_category() and is_tag(), as it would catch those taxonomies as well.
// This also supports product groups via is_tax(). Only product groups that are WordPress custom taxonomies are supported.
} elseif (is_tax()) {
// Taxonomy term object.
// When viewing taxonomy archives, the $post object is the taxonomy term object. Check with: var_dump($post);
$tax_term_object = $post;
//var_dump($tax_term_object);
if ($do_description) {
// If set, the description of the custom taxonomy term is used in the 'description' metatag.
// Otherwise, a generic description is used.
// Here we sanitize the provided description for safety
$description_content = sanitize_text_field(amt_sanitize_description(term_description($tax_term_object->term_id, $tax_term_object->taxonomy)));
// Note: Contains multipage information through amt_process_paged()
if (empty($description_content)) {
示例15: suffusion_get_category_information
</article><!--post -->
<?php
}
$class = "";
$information = "";
if (in_array('category', $context)) {
$information = $suf_cat_info_enabled == 'enabled' ? suffusion_get_category_information() : false;
$class = 'info-category';
} else {
if (in_array('author', $context)) {
$information = $suf_author_info_enabled == 'enabled' ? suffusion_get_author_information() : false;
$class = 'author-profile';
} else {
if (in_array('tag', $context)) {
$tag_id = get_query_var('tag_id');
$information = $suf_tag_info_enabled == 'enabled' ? tag_description($tag_id) : false;
$class = 'info-tag';
}
}
}
if ($suffusion_full_post_count_for_view == 0) {
?>
<section class='post <?php
echo $class;
?>
fix'>
<?php
if (!$hide_title) {
?>
<header class="post-header">
<h2 class="posttitle"><?php