本文整理汇总了PHP中the_category函数的典型用法代码示例。如果您正苦于以下问题:PHP the_category函数的具体用法?PHP the_category怎么用?PHP the_category使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了the_category函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: formatAttribute
function formatAttribute()
{
global $post;
?>
<ul class="post-in">
<li>
<?php
esc_html_e("Posted In : ", "charity");
the_category(" , ");
$tags = get_tags();
if (!empty($tags)) {
the_tags(" , ");
}
?>
</li>
<li>
<a href="<?php
comments_link();
?>
"><?php
comments_number('0 : comment', '1 : comment', '% : comments');
?>
</a>
</li>
</ul>
<?php
}
开发者ID:Angelpm28,项目名称:ong-canada,代码行数:27,代码来源:post-format-hooks.php
示例2: magnificient_entry_meta
function magnificient_entry_meta()
{
echo '<span class="byline author"><a href="' . get_author_posts_url(get_the_author_meta('ID')) . '" rel="author" class="fn">' . get_the_author() . '</a> • </span>';
echo '<time class="updated" datetime="' . get_the_time('c') . '" pubdate><a href="' . get_permalink() . '">' . get_the_time('F jS, Y') . '</a> • </time>';
echo '<span class="entry-category">' . the_category('•') . '</span>';
echo '<span class="entry-tags">' . the_tags(' • ', ' • ', '') . '</span>';
}
开发者ID:ThemeJungles,项目名称:Magnificient_tutorial,代码行数:7,代码来源:entry-meta.php
示例3: foundationpress_entry_meta
function foundationpress_entry_meta()
{
echo '<div class="meta"><time class="updated" datetime="' . get_the_time('c') . '">' . sprintf(__('%s', 'foundationpress'), get_the_date(), get_the_time()) . '</time>';
echo ' | Published in: ';
the_category(', ');
echo '</div>';
}
开发者ID:AdamChlan,项目名称:BuchartHorn,代码行数:7,代码来源:entry-meta.php
示例4: blog_page_feed
function blog_page_feed()
{
$paged = get_query_var('paged', 1);
$args = array('posts_per_page' => 10, 'paged' => $paged);
$the_query = new WP_Query($args);
// TAILOR PAGER BEHAVIOR TO NUMBER OF POSTS
if ($the_query->found_posts <= 10) {
$pager_class = 'pager-div-collapse';
} else {
$pager_class = 'pager-div';
}
if ($the_query->have_posts()) {
while ($the_query->have_posts()) {
$the_query->the_post();
// START THE LOOP
echo '<div class="blog-feed">';
echo '<h2><a href="' . get_permalink() . '" class="blog-title">' . get_the_title() . '</a></h2>';
echo '<p>Posted on ' . get_the_time('F j, Y') . '</p>';
echo get_the_post_thumbnail();
echo the_content("Continue reading " . get_the_title());
echo '<p>Posted in ';
the_category(', ');
echo '</p>';
echo '<hr>';
echo '</div>';
}
echo '<div class="' . $pager_class . '">';
echo '<h4 class="forward-paging-link">' . get_next_posts_link('More Blog Posts »', $the_query->max_num_pages) . '</h4>';
echo '<h4 class="backward-paging-link">' . get_previous_posts_link('« Previous Blog Posts') . '</h4>';
echo '</div>';
wp_reset_postdata();
//reset
}
//END THE LOOP
}
开发者ID:msinkula,项目名称:the-art-of-alzheimers,代码行数:35,代码来源:functions.php
示例5: totomo_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function totomo_posted_on()
{
// Default info will be shown
$post_format = get_post_format(get_the_ID());
?>
<ul class="post-meta clearfix">
<li>
<time class="date fa fa-clock-o" datetime="<?php
the_time('c');
?>
" pubdate><?php
the_time(get_option('date_format'));
?>
</time>
</li>
<li>
<?php
comments_popup_link(__('No Comments', 'totomo'), __('1 Comment', 'totomo'), __('% Comments', 'totomo'), 'comments-link fa fa-comments');
?>
</li>
<li class="fa fa-tags">
<?php
the_category(', ');
?>
</li>
</ul>
<?php
}
开发者ID:slee124565,项目名称:flh-pvstation,代码行数:31,代码来源:template-tags.php
示例6: the_breadcrumb
function the_breadcrumb()
{
if (!is_home()) {
echo '<a href="';
echo get_option('home');
echo '">';
echo "<img src=\"";
echo bloginfo('stylesheet_directory');
echo "/css/images/breadcrumbs_spinner.png\" style=\"display: block; float: left; margin: 0 10px 0 12px;\" />";
// bloginfo('name');
echo "</a> <img src=\"";
echo bloginfo('stylesheet_directory');
echo "/css/images/breadcrumbs_separrow.png\" style=\"display: block; float: left; margin: 0 0 0 -2px;\" /> ";
if (is_category() || is_single()) {
echo "<ul>";
the_category('title_li=');
if (is_single()) {
echo " » ";
the_title();
}
} elseif (is_page()) {
echo "<ul><li>";
echo the_title();
echo "</li></ul>";
}
}
}
开发者ID:macconsultinggroup,项目名称:WordPress,代码行数:27,代码来源:functions.php
示例7: post_meta
function post_meta()
{
?>
<ul class="post_meta">
<li class="date"><?php
echo get_the_date();
?>
</li>
<li class="category"><?php
the_category(', ');
?>
</li>
<?php
$post_tags = wp_get_post_tags($post->ID);
if (!empty($post_tags)) {
?>
<li class="tags"><?php
the_tags('', ', ', '');
?>
</li>
<?php
}
?>
</ul><!-- .post-meta -->
<?php
}
开发者ID:rigelstpierre,项目名称:Everlovin-Press,代码行数:26,代码来源:meta.php
示例8: MyBreadcrumb
function MyBreadcrumb()
{
if (!is_home()) {
echo '<li><a href="';
echo get_option('home');
echo '/">';
echo 'Home';
echo '</a><span class="divider">/</span></li>';
if (is_category() || is_single()) {
echo '<li>';
the_category(', ', '&title_li=');
echo '<span class="divider">/</span></li>';
echo '</li>';
if (is_single()) {
echo '<li class="active">';
// the_title();
echo '</li>';
}
} elseif (is_page()) {
echo '<li class="active">';
the_title();
echo '</li>';
}
}
}
开发者ID:sykot,项目名称:wp-bs,代码行数:25,代码来源:functions.php
示例9: the_breadcrumb
function the_breadcrumb()
{
echo '<div class="e-breadcrumbs">';
echo '<a href="';
echo get_option('home');
echo '">';
bloginfo('name');
echo "</a>";
if (is_category() || is_single()) {
echo " » ";
the_category(' • ');
if (is_single()) {
echo " » ";
the_title();
}
} elseif (is_page()) {
echo " » ";
echo the_title();
} elseif (is_search()) {
echo " » Search Results for... ";
echo '"<em>';
echo the_search_query();
echo '</em>"';
}
echo '</div>';
}
开发者ID:aIbarrab,项目名称:cbrclub,代码行数:26,代码来源:breadcrumbs.php
示例10: 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
示例11: b_wp_contents_show
function b_wp_contents_show($options)
{
// global $xoopsDB,$xoopsUser;
// global $tableoptions,$tableusers;
// global $id, $posts, $post, $day, $previousday, $newday;
$id = 1;
global $posts, $post, $day, $previousday, $newday;
global $dateformat, $time_difference, $siteurl, $blogfilename;
global $tablelinks, $tablelinkcategories;
global $querystring_start, $querystring_equal, $querystring_separator, $month, $wpdb, $start_of_week;
global $tableposts, $tablepost2cat, $tablecomments, $tablecategories;
global $smilies_directory, $use_smilies, $wp_smiliessearch, $wp_smiliesreplace;
global $wp_bbcode, $use_bbcode, $wp_gmcode, $use_gmcode, $use_htmltrans, $wp_htmltrans, $wp_htmltranswinuni;
require_once dirname(__FILE__) . '/../wp-blog-header.php';
$blog = 1;
$block = array();
$block['siteurl'] = $siteurl;
foreach ($posts as $post) {
$content = array();
start_wp();
$content['date'] = the_date('', '<h2>', '</h2>', false);
$content['time'] = the_time('', false);
$content['title'] = the_title('', '', false);
$content['permlink'] = get_permalink();
//
ob_start();
the_author();
$content['author'] = ob_get_contents();
ob_end_clean();
//
ob_start();
the_category();
$content['category'] = ob_get_contents();
ob_end_clean();
//
ob_start();
the_content();
$content['body'] = ob_get_contents();
ob_end_clean();
//
ob_start();
link_pages('<br />Pages: ', '<br />', 'number');
$content['linkpage'] = ob_get_contents();
ob_end_clean();
//
ob_start();
comments_popup_link('Comments (0)', 'Comments (1)', 'Comments (%)');
$content['comments'] = ob_get_contents();
ob_end_clean();
//
ob_start();
trackback_rdf();
$content['trackback'] = ob_get_contents();
ob_end_clean();
//
$block['contents'][] = $content;
}
return $block;
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:59,代码来源:wp_contents.php
示例12: post_category
public function post_category($atts)
{
ob_start();
the_category(', ');
$category = ob_get_contents();
ob_end_clean();
return sprintf('<span class="tf_post_category">%s</span>', $category);
}
开发者ID:jhostetter,项目名称:wp_intern_themes,代码行数:8,代码来源:post-meta.php
示例13: widget
function widget($args, $instance)
{
extract($args);
?>
<?php
echo $before_widget;
?>
<?php
if ($instance['title']) {
echo $before_title . $instance['title'] . $after_title;
}
?>
<ul class="spy">
<?php
query_posts(array('posts_per_page' => 5, 'orderby' => 'rand', 'caller_get_posts' => 1));
while (have_posts()) {
the_post();
?>
<li><?php
if (has_post_thumbnail()) {
?>
<div class="img"><?php
the_post_thumbnail('thumbnail', array('alt' => trim(strip_tags($post->post_title)), 'title' => trim(strip_tags($post->post_title))));
?>
</div><?php
}
?>
<h2><a href="<?php
the_permalink();
?>
" title="<?php
the_title();
?>
"><?php
the_title();
?>
</a></h2>
<div class="fcats"><?php
the_category(', ');
?>
</div>
<div class="fcats"><?php
the_time('Y.m.d');
?>
</div>
</li>
<?php
}
wp_reset_query();
?>
</ul>
<?php
echo $after_widget;
?>
<?php
}
开发者ID:xiapistudio,项目名称:change,代码行数:57,代码来源:widget-recommend.php
示例14: xjsxj_posted_on
/**
* Prints HTML with meta information for the current post—date/time and author.
*
* @since xjsxj 1.0
*/
function xjsxj_posted_on()
{
printf(__('<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s ', 'xjsxj'), 'meta-prep meta-prep-author', sprintf('<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>', get_permalink(), esc_attr(get_the_date()), get_the_time('Y/m/d')), sprintf('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', get_author_posts_url(get_the_author_meta('ID')), sprintf(esc_attr__('View all posts by %s', 'xjsxj'), get_the_author()), get_the_author()));
// added by rocketxujia
echo __('评论[');
comments_popup_link('0', '1', '%');
echo __('] -');
the_category(', ');
}
开发者ID:rocketxujia,项目名称:xjsxj,代码行数:14,代码来源:functions.php
示例15: agatha_breadcrumb
function agatha_breadcrumb()
{
global $post;
echo '<ul id="trilha">';
if (!is_home()) {
echo '<li><a href="';
echo get_option('home');
echo '">';
echo 'Página inicial';
echo '</a></li><li class="separador"> / </li>';
if (is_category() || is_single()) {
echo '<li>';
the_category(' </li><li class="separador"> / </li><li> ');
if (is_single()) {
echo '</li><li class="separador"> / </li><li>';
the_title();
echo '</li>';
}
} elseif (is_page()) {
if ($post->post_parent) {
$anc = get_post_ancestors($post->ID);
$title = get_the_title();
foreach ($anc as $ancestor) {
$output = '<li><a href="' . get_permalink($ancestor) . '" title="' . get_the_title($ancestor) . '">' . get_the_title($ancestor) . '</a></li> <li class="separador">/</li>';
}
echo $output;
echo '<strong title="' . $title . '"> ' . $title . '</strong>';
} else {
echo '<li><strong> ' . get_the_title() . '</strong></li>';
}
}
} elseif (is_tag()) {
single_tag_title();
} elseif (is_day()) {
echo "<li>Arquivo de ";
the_time('j \\d\\e F \\d\\e Y');
echo '</li>';
} elseif (is_month()) {
echo "<li>Arquivo de ";
the_time('F \\d\\e Y');
echo '</li>';
} elseif (is_year()) {
echo "<li>Arquivo de ";
the_time('Y');
echo '</li>';
} elseif (is_author()) {
echo "<li>Arquivo do autor";
echo '</li>';
} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
echo "<li>Arquivo do blog";
echo '</li>';
} elseif (is_search()) {
echo "<li>Resultados da pesquisa";
echo '</li>';
}
echo '</ul>';
}
开发者ID:ericsoncardosoweb,项目名称:agatha-wp,代码行数:57,代码来源:breadcrumbs.php
示例16: c_widget_category
/**
* @desc Output of the Category
* @author Georg Leciejewski
*/
function c_widget_category($args, $number = 1)
{
$options = get_option('c_widget_category');
$before_widget = stripslashes($options[$number]['before_widget']);
$after_widget = stripslashes($options[$number]['after_widget']);
echo $before_widget;
the_category();
echo $after_widget;
}
开发者ID:jbogota,项目名称:blog-king,代码行数:13,代码来源:c_widget_category.php
示例17: breadcrumbs
function breadcrumbs()
{
global $post;
echo '<ol class="breadcrumb">';
if (!is_home()) {
echo '<li><a href="';
echo get_option('home');
echo '">';
echo 'Home';
echo '</a></li>';
if (is_category() || is_single()) {
echo '<li>';
the_category(' </li><li> ');
if (is_single()) {
echo '</li><li>';
the_title();
echo '</li>';
}
} elseif (is_page()) {
if ($post->post_parent) {
$anc = get_post_ancestors($post->ID);
$title = get_the_title();
foreach ($anc as $ancestor) {
$output = '<li><a href="' . get_permalink($ancestor) . '" title="' . get_the_title($ancestor) . '">' . get_the_title($ancestor) . '</a></li> ';
}
echo $output;
echo '<strong title="' . $title . '"> ' . $title . '</strong>';
} else {
echo '<li><strong> ' . get_the_title() . '</strong></li>';
}
}
} elseif (is_tag()) {
single_tag_title();
} elseif (is_day()) {
echo "<li>Archive for ";
the_time('F jS, Y');
echo '</li>';
} elseif (is_month()) {
echo "<li>Archive for ";
the_time('F, Y');
echo '</li>';
} elseif (is_year()) {
echo "<li>Archive for ";
the_time('Y');
echo '</li>';
} elseif (is_author()) {
echo "<li>Author Archive";
echo '</li>';
} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
echo "<li>Blog Archives";
echo '</li>';
} elseif (is_search()) {
echo "<li>Search Results";
echo '</li>';
}
echo '</ol>';
}
开发者ID:andresmatasuarez,项目名称:jedbangers-web,代码行数:57,代码来源:functions.php
示例18: diarjolite_after_content_function
/**
* Wp in Progress
*
* @package Wordpress
* @author WPinProgress
*
* This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
* It is also available at this URL: http://www.gnu.org/licenses/gpl-3.0.txt
*/
function diarjolite_after_content_function()
{
if (is_home() || is_category() || is_search() || is_tag() || is_page() && get_post_type() != "page") {
do_action('diarjolite_excerpt');
?>
<div class="post-info">
<div class="left"> <?php
echo get_the_date('m.d.Y');
?>
</div>
<div class="right"> <?php
the_category(', ');
?>
</div>
</div>
<div class="clear"></div>
<?php
} else {
if (is_single()) {
?>
<div class="line"> <span> <?php
echo __("On ", "diarjolite") . get_the_date() . __(" by ", "diarjolite") . get_the_author();
?>
</span> </div>
<?php
}
the_content();
echo '<div class="clear"></div>';
if (get_post_type() == "post") {
?>
<div class="post-info">
<div class="left"> <?php
the_category(', ');
?>
</div>
<div class="right"> <?php
the_tags('Tags: ', ', ', '');
?>
</div>
</div>
<div class="clear"></div>
<?php
}
}
?>
<?php
}
开发者ID:tlovett1,项目名称:tlcom-theme,代码行数:64,代码来源:after-content.php
示例19: wcr_author_loop
function wcr_author_loop()
{
$args = array('author' => get_the_author_meta('ID'), 'orderby' => 'post_date', 'order' => 'DESC', 'posts_per_page' => '10');
$loop = new WP_Query($args);
if ($loop->have_posts()) {
// loop through posts
while ($loop->have_posts()) {
$loop->the_post();
?>
<article class="entry" itemprop="blogPost" itemtype="http://schema.org/BlogPosting" itemscope="itemscope">
<header class="entry-header">
<a href="<?php
echo get_permalink();
?>
" title="<?php
the_title();
?>
">
<h1 itemprop="headline"> <?php
the_title();
?>
</h1>
</a>
<p class="entry-meta">
<?php
the_time('l, F jS, Y');
echo ' by ';
the_author();
?>
</header>
<div class="author-blog entry-content">
<?php
if (has_post_thumbnail()) {
the_post_thumbnail('medium');
}
?>
<?php
the_excerpt();
?>
</div>
<footer>
Categories: <?php
the_category(', ');
?>
</footer>
</article>
<?php
}
}
wp_reset_postdata();
}
开发者ID:andrygorokhovets,项目名称:western,代码行数:55,代码来源:mike-page.php
示例20: the_crumbs
function the_crumbs()
{
echo '<nav class="crumbs">现在位置: ';
echo '<a title="返回首页" href="';
echo get_settings('home');
echo '">';
echo '首页';
echo "</a>";
if (is_category()) {
echo ' > ';
echo get_category_parents(get_query_var('cat'), true, ' > ');
echo ' 文章 ';
}
if (is_single()) {
echo ' > ';
echo the_category(' > ', 'multiple');
echo ' > ';
echo ' 正文 ';
}
if (is_page()) {
echo ' > ';
echo the_title();
} elseif (is_tag()) {
echo ' > ';
single_tag_title();
echo ' > 文章 ';
} elseif (is_day()) {
echo ' > ';
echo "发表于";
the_time('Y年m月d日');
echo '的文章';
} elseif (is_month()) {
echo ' > ';
echo "发表于";
the_time('Y年m月');
echo '的文章';
} elseif (is_year()) {
echo ' > ';
echo "发表于";
the_time('Y年');
echo '的文章';
} elseif (is_author()) {
echo ' > ';
echo wp_title('');
echo '发表的文章';
} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
echo "Blog Archives";
echo '';
} elseif (is_search()) {
echo ' > ';
echo "搜索结果";
echo '';
}
echo '</nav>';
}
开发者ID:areszn,项目名称:wordpress,代码行数:55,代码来源:breadcrumb.php
注:本文中的the_category函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论