• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP tag_description函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了tag_description函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 {
开发者ID:BetterDigitalServices,项目名称:bluearrow,代码行数:67,代码来源:wonderm00n-open-graph.php


示例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);
    }
}
开发者ID:carpliyz,项目名称:9IPHP,代码行数:30,代码来源:header.php


示例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));
 }
开发者ID:lonid,项目名称:skrollr,代码行数:26,代码来源:register.php


示例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";
}
开发者ID:frostfan,项目名称:Lost,代码行数:32,代码来源:functions.php


示例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 
        }
    }
开发者ID:wpmonty,项目名称:sharp-light,代码行数:54,代码来源:theme-functions.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>';
    }
}
开发者ID:sudar,项目名称:rolopress-core,代码行数:53,代码来源:content-functions.php


示例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";
 }
开发者ID:benno9,项目名称:my-plain-theme,代码行数:17,代码来源:functions.php


示例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?&nbsp;</span><span>Przeglądasz archiwa oznaczone tagiem&nbsp;</span><span class="spacer2">&nbsp;<?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;">
开发者ID:roborovski,项目名称:sg-mik,代码行数:31,代码来源:sidebar.php


示例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>');
                            }
//.........这里部分代码省略.........
开发者ID:saki1001,项目名称:sj-2015,代码行数:101,代码来源:functions.php


示例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.
         */
开发者ID:brifishjones,项目名称:wp-forge,代码行数:30,代码来源:tag.php


示例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(); ?>
开发者ID:OanaRaluca,项目名称:Wordpress-theme-8,代码行数:31,代码来源:tag.php


示例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 
        }
        ?>
        
开发者ID:eugenehiggins,项目名称:wellnessrx,代码行数:30,代码来源:loop.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()) {
开发者ID:6226,项目名称:wp,代码行数:31,代码来源:archive.php


示例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)) {
开发者ID:rpi-virtuell,项目名称:wordpress-add-meta-tags,代码行数:67,代码来源:amt_basic.php


示例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 
开发者ID:kevinaxu,项目名称:99boulders,代码行数:31,代码来源:layout-mosaic.php


示例16: tag_description

        ?>
                    <div class="td-pb-span12 td-main-content">
                        <div class="td-ss-main-content">
                            <div class="td-page-header">
                                <h1 itemprop="name" class="entry-title td-page-title">
                                    <?php 
        /*<a itemprop="url" href="<?php echo get_tag_link(get_query_var('tag_id'));?>" rel="bookmark" title="<?php echo __td('Posts in ') . $current_tag_name?>"><?php echo $current_tag_name ?></a>*/
        ?>
                                    <span><?php 
        echo $current_tag_name;
        ?>
</span>
                                </h1>
                            </div>
                            <?php 
        $td_tag_description = tag_description();
        if (!empty($td_tag_description)) {
            echo '<div class="entry-content">';
            echo $td_tag_description;
            echo '</div>';
        }
        locate_template('loop.php', true);
        echo td_page_generator::get_pagination();
        ?>
                        </div>
                    </div>
                    <?php 
        break;
}
?>
        </div> <!-- /.td-pb-row -->
开发者ID:rinodung,项目名称:newspaper-wordpress,代码行数:31,代码来源:tag.php


示例17: biz_vektor_getHeadDescription

function biz_vektor_getHeadDescription()
{
    global $wp_query;
    $post = $wp_query->get_queried_object();
    if (is_home() || is_page('home') || is_front_page()) {
        if (isset($post->post_excerpt) && $post->post_excerpt) {
            $metadescription = $post->post_excerpt;
        } else {
            $metadescription = get_bloginfo('description');
        }
    } else {
        if (is_category() || is_tax()) {
            $metadescription = $post->category_description;
            if (!$metadescription) {
                $metadescription = sprintf(__('About %s', 'biz-vektor'), single_cat_title()) . get_bloginfo('name') . ' ' . get_bloginfo('description');
            }
        } else {
            if (is_tag()) {
                $metadescription = strip_tags(tag_description());
                $metadescription = str_replace(array("\r\n", "\r", "\n"), '', $metadescription);
                // delete br
                if (!$metadescription) {
                    $metadescription = sprintf(__('About %s', 'biz-vektor'), single_tag_title()) . get_bloginfo('name') . ' ' . get_bloginfo('description');
                }
            } else {
                if (is_archive()) {
                    if (is_year()) {
                        $description_date = get_the_date(_x('Y', 'yearly archives date format', 'biz-vektor'));
                        $metadescription = sprintf(_x('Article of %s.', 'Yearly archive description', 'biz-vektor'), $description_date);
                        $metadescription .= ' ' . get_bloginfo('name') . ' ' . get_bloginfo('description');
                    } else {
                        if (is_month()) {
                            $description_date = get_the_date(_x('F Y', 'monthly archives date format', 'biz-vektor'));
                            $metadescription = sprintf(_x('Article of %s.', 'Archive description', 'biz-vektor'), $description_date);
                            $metadescription .= ' ' . get_bloginfo('name') . ' ' . get_bloginfo('description');
                        } else {
                            if (is_author()) {
                                $userObj = get_queried_object();
                                $metadescription = sprintf(_x('Article of %s.', 'Archive description', 'biz-vektor'), esc_html($userObj->display_name));
                                $metadescription .= ' ' . get_bloginfo('name') . ' ' . get_bloginfo('description');
                            } else {
                                $postType = get_post_type();
                                $metadescription = sprintf(_x('Article of %s.', 'Archive description', 'biz-vektor'), esc_html(get_post_type_object($postType)->labels->name));
                                $metadescription .= ' ' . get_bloginfo('name') . ' ' . get_bloginfo('description');
                            }
                        }
                    }
                } else {
                    if (is_page() || is_single()) {
                        $metaExcerpt = $post->post_excerpt;
                        if ($metaExcerpt) {
                            // $metadescription = strip_tags($post->post_excerpt);
                            $metadescription = strip_tags($post->post_excerpt);
                        } else {
                            $metadescription = mb_substr(strip_tags($post->post_content), 0, 240);
                            // kill tags and trim 240 chara
                            $metadescription = str_replace(array("\r\n", "\r", "\n"), ' ', $metadescription);
                            // delete br
                        }
                    } else {
                        $metadescription = get_bloginfo('description');
                    }
                }
            }
        }
    }
    global $paged;
    if ($paged != '0') {
        $metadescription = '[' . sprintf(__('Page of %s', 'biz-vektor'), $paged) . '] ' . $metadescription;
    }
    $metadescription = apply_filters('metadescriptionCustom', $metadescription);
    echo $metadescription;
}
开发者ID:liuminhan,项目名称:wordpress,代码行数:73,代码来源:functions.php


示例18: __

					printf( __( 'Yearly Archives: %s', 'pinktouch' ), '<span>' . get_the_date( 'Y' ) . '</span>' );
				elseif ( is_tag() ) :
					printf( __( 'Tag Archives: %s', 'pinktouch' ), '<span>' . single_tag_title( '', false ) . '</span>' );
				elseif ( is_author() ) :
					printf( __( 'Posted by: %s', 'pinktouch' ), '<span>' . get_the_author() . '</span>' );
				elseif ( is_category() ) :
					printf( __( 'Category Archives: %s', 'pinktouch' ), '<span>' . single_cat_title( '', false ) . '</span>' );
				else :
					_e( 'Archives', 'pinktouch' );
				endif;
			?>
			</h1>

			<?php $category_description = category_description(); if ( ! empty( $category_description ) ) echo apply_filters( 'archive_meta', '<div class="archive-meta">' . $category_description . '</div>' ); ?>

			<?php $tag_description = tag_description(); if ( ! empty( $tag_description ) ) echo apply_filters( 'tag_archive_meta', '<div class="archive-meta">' . $tag_description . '</div>' ); ?>

		</div>
	<?php endif; ?>

	<?php if ( is_search() ) : ?>
		<div class="page-header">
			<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'pinktouch' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
		</div>
	<?php endif; ?>

	<?php rewind_posts(); ?>

	<?php if ( have_posts() ) : ?>

		<?php while ( have_posts() ) : the_post(); ?>
开发者ID:kevinreilly,项目名称:mendelements.com,代码行数:31,代码来源:index.php


示例19: get_post_meta

if (is_single() || is_page()) {
    $wipLayoutMeta = get_post_meta($post->ID, '_layout', true);
    $wipHeadMeta = get_post_meta($post->ID, 'head', true);
    $wipBodyMeta = get_post_meta($post->ID, 'body', true);
    if (is_page()) {
        $wipDynamicMeta = get_post_meta($post->ID, '_dynamic', true);
    }
} else {
    $wipDynamicMeta = false;
    $wipLayoutMeta = false;
    $wipHeadMeta = false;
    $wipBodyMeta = false;
}
// Taxonomy-specific variables
$catDesc = category_description();
$tagDesc = tag_description();
?>
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="<?php 
bloginfo('charset');
?>
">
		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
		<title><?php 
wp_title('');
if (wp_title('', false)) {
  

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP tag_display_name函数代码示例发布时间:2022-05-23
下一篇:
PHP tag_deliver函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap