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


PHP get_the_category_list函数代码示例

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


在下文中一共展示了get_the_category_list函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: great_entry_footer

    /**
     * Prints HTML with meta information for the categories, tags and comments.
     */
    function great_entry_footer()
    {
        // Featured Star
        if (is_sticky() && is_home() && !is_paged()) {
            printf('<span class="sticky-post"><i class="fa fa-star"></i> %s</span>', __('Featured', 'great'));
        }
        // Post Author
        if (get_theme_mod('display_post_author', 1)) {
            $byline = '	<span class="author vcard">
				<a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">
				' . esc_html(get_the_author()) . '</a></span>';
            echo '<span class="byline"><i class="fa fa-user"></i> ' . $byline . '</span>';
        }
        // Hide category and tag text for pages.
        if ('post' == get_post_type()) {
            /* translators: used between list items, there is a space after the comma */
            $categories_list = get_the_category_list(__(', ', 'great'));
            if ($categories_list && great_categorized_blog() && get_theme_mod('display_post_cats', 1)) {
                printf('<span class="cat-links"><i class="fa fa-folder"></i> ' . '%1$s' . '</span>', $categories_list);
            }
            /* translators: used between list items, there is a space after the comma */
            $tags_list = get_the_tag_list('', __(', ', 'great'));
            if ($tags_list and get_theme_mod('display_post_tags', 1)) {
                printf('<span class="tags-links"><i class="fa fa-tags"></i> ' . '%1$s' . '</span>', $tags_list);
            }
        }
    }
开发者ID:karthikakamalanathan,项目名称:wp-cookieLawInfo,代码行数:30,代码来源:template-tags.php

示例2: storefront_post_meta

    /**
     * Display the post meta
     * @since 1.0.0
     */
    function storefront_post_meta()
    {
        ?>
		<aside class="entry-meta">
			<?php 
        if ('post' == get_post_type()) {
            // Hide category and tag text for pages on Search
            ?>

			<?php 
            /* translators: used between list items, there is a space after the comma */
            $categories_list = get_the_category_list(__(', ', 'storefront'));
            if ($categories_list && storefront_categorized_blog()) {
                ?>
				<span class="cat-links">
					<?php 
                echo '<span class="screen-reader-text">' . esc_attr(__('Categories: ', 'storefront')) . '</span>';
                echo wp_kses_post($categories_list);
                ?>
				</span>
			<?php 
            }
            // End if categories
            ?>

			<?php 
            /* translators: used between list items, there is a space after the comma */
            $tags_list = get_the_tag_list('', __(', ', 'storefront'));
            if ($tags_list) {
                ?>
				<span class="tags-links">
					<?php 
                echo '<span class="screen-reader-text">' . esc_attr(__('Tags: ', 'storefront')) . '</span>';
                echo wp_kses_post($tags_list);
                ?>
				</span>
			<?php 
            }
            // End if $tags_list
            ?>

			<?php 
        }
        // End if 'post' == get_post_type()
        ?>

<!-- 			<?php 
        if (!post_password_required() && (comments_open() || '0' != get_comments_number())) {
            ?>
				<span class="comments-link"><?php 
            comments_popup_link(__('Leave a comment', 'storefront'), __('1 Comment', 'storefront'), __('% Comments', 'storefront'));
            ?>
</span>
			<?php 
        }
        ?>
 -->
		</aside>
		<?php 
    }
开发者ID:kn0wbody,项目名称:homeboyadvance_storefront,代码行数:64,代码来源:post.php

示例3: appletree_post_meta

/**
 * Displays meta information for a post
 * @return void
 */
function appletree_post_meta()
{
    if (get_post_type() == 'post') {
        echo sprintf(__('Posted %s in %s%s by %s. ', 'appletreesg.com'), get_the_time(get_option('date_format')), get_the_category_list(', '), get_the_tag_list(__(', <b>Tags</b>: ', 'appletreesg.com'), ', '), get_the_author_link());
    }
    edit_post_link(__(' (edit)', 'appletreesg.com'), '<span class="edit-link">', '</span>');
}
开发者ID:scarecrow2003,项目名称:appletree,代码行数:11,代码来源:functions.php

示例4: impronta_metadata

 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function impronta_metadata()
 {
     // Hide category and tag text for pages.
     if ('post' === get_post_type()) {
         echo '<p class="metadata">';
         $byline = sprintf(esc_html_x('By %s', 'post author', 'impronta'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span> ');
         echo $byline;
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', 'impronta'));
         if ($categories_list && impronta_categorized_blog()) {
             printf('<span class="cat-links">' . esc_html_x('on %1$s ', 'on categories', 'impronta') . '</span>', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', 'impronta'));
         if ($tags_list) {
             printf(esc_html__('tagged %1$s', 'impronta'), $tags_list);
             // WPCS: XSS OK.
         }
         if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
             if (get_comments_number(get_the_id()) == 0) {
                 echo esc_html__('- ', 'impronta');
             } else {
                 echo esc_html__('with ', 'impronta');
             }
             comments_popup_link(esc_html__('Leave a comment', 'impronta'), esc_html__('1 Comment', 'impronta'), esc_html__('% Comments', 'impronta'));
         }
         if (is_sticky()) {
             echo ' - ' . '<i class="feature-star fa fa-star" data-toggle="tooltip" data-placement="right" title="' . esc_attr__('Featured Post', 'impronta') . '"></i>';
         }
         echo '</p>';
     }
 }
开发者ID:nicoandrade,项目名称:Impronta,代码行数:36,代码来源:template-tags.php

示例5: listable_entry_footer

 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function listable_entry_footer()
 {
     // Hide category and tag text for pages.
     if ('post' === get_post_type()) {
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', 'listable'));
         if ($categories_list && listable_categorized_blog()) {
             printf('<span class="cat-links">' . esc_html__('Posted in %1$s', 'listable') . '</span>', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', 'listable'));
         if ($tags_list) {
             printf('<span class="tags-links">' . esc_html__('Tagged %1$s', 'listable') . '</span>', $tags_list);
             // WPCS: XSS OK.
         }
     }
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link">';
         comments_popup_link(esc_html__('Leave a comment', 'listable'), esc_html__('1 Comment', 'listable'), esc_html__('% Comments', 'listable'));
         echo '</span>';
     }
     //
     //	edit_post_link(
     //		sprintf(
     //			/* translators: %s: Name of current post */
     //			esc_html__( 'Edit %s', 'listable' ),
     //			the_title( '<span class="screen-reader-text">"', '"</span>', false )
     //		),
     //		'<span class="edit-link">',
     //		'</span>'
     //	);
 }
开发者ID:swaroop42,项目名称:RockRose,代码行数:36,代码来源:template-tags.php

示例6: tokopress_entry_meta

 function tokopress_entry_meta()
 {
     // Translators: used between list items, there is a space after the comma.
     $categories_list = get_the_category_list(__(', ', 'tokopress'));
     // Translators: used between list items, there is a space after the comma.
     $tag_list = get_the_tag_list('', __(', ', 'tokopress'));
     $date = sprintf('<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>', esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date()));
     $author = sprintf('<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'tokopress'), get_the_author())), get_the_author());
     // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
     if (is_singular()) {
         if ($tag_list) {
             $utility_text = __('<span class="post-date">%3$s</span><span class="post-categories">%1$s</span><span class="post-tags">%2$s</span><span class="post-author"> by %4$s</span>', 'tokopress');
         } elseif ($categories_list) {
             $utility_text = __('<span class="post-date">%3$s</span><span class="post-categories">%1$s</span><span class="post-author"> by %4$s</span>', 'tokopress');
         } else {
             $utility_text = __('<span class="post-date">%3$s</span><span class="post-author"> by %4$s</span>', 'tokopress');
         }
     } else {
         if ($categories_list) {
             $utility_text = __('<span class="post-date">%3$s</span><span class="post-categories">%1$s</span><span class="post-author"> by %4$s</span>', 'tokopress');
         } else {
             $utility_text = __('<span class="post-date">%3$s</span><span class="by-author"> by %4$s</span>', 'tokopress');
         }
     }
     printf($utility_text, $categories_list, $tag_list, $date, $author);
 }
开发者ID:rtmzzi,项目名称:yummMacVersao,代码行数:26,代码来源:frontend.php

示例7: _loa_entry_footer

 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function _loa_entry_footer()
 {
     // Hide category and tag text for pages.
     if ('post' === get_post_type()) {
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', '_loa'));
         if ($categories_list && _loa_categorized_blog()) {
             printf('<span class="cat-links">' . esc_html__('Posted in %1$s', '_loa') . '</span>', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', '_loa'));
         if ($tags_list) {
             printf('<span class="tags-links">' . esc_html__(', %1$s', '_loa') . '</span>', $tags_list);
             // WPCS: XSS OK.
         }
     }
     // // // // UNCOMMENT THIS FOR "Leave A Comment" IN ENTRY FOOTER // // // // //
     // if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
     // 	echo '<span class="comments-link">';
     // 	comments_popup_link( esc_html__( 'Leave a comment', '_loa' ), esc_html__( '1 Comment', '_loa' ), esc_html__( '% Comments', '_loa' ) );
     // 	echo '</span>';
     // }
     edit_post_link(sprintf(esc_html__('Edit %s', '_loa'), the_title('<span class="screen-reader-text">"', '"</span>', false)), '<span class="edit-link">', '</span>');
 }
开发者ID:dylanjharris,项目名称:loa,代码行数:28,代码来源:template-tags.php

示例8: jinn_entry_footer

 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function jinn_entry_footer()
 {
     global $post;
     // Hide category and tag text for pages.
     if ('post' === get_post_type() || 'jetpack-portfolio' === get_post_type()) {
         /* translators: used between list items, there is a space after the comma */
         if ('post' === get_post_type()) {
             $categories_list = get_the_category_list(esc_html__(', ', 'jinn'));
         } elseif ('jetpack-portfolio' === get_post_type()) {
             $categories_list = get_the_term_list($post->ID, 'jetpack-portfolio-type', '', esc_html_x(', ', 'Used between list items, there is a space after the comma.', 'jinn'), '');
         }
         if ($categories_list && jinn_categorized_blog()) {
             printf('<span class="cat-links">' . $categories_list . '</span>', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         if ('post' === get_post_type()) {
             $tags_list = get_the_tag_list('<li class="label radius">', '</li><li class="label radius">', '</li>');
         } elseif ('jetpack-portfolio' === get_post_type()) {
             $tags_list = get_the_term_list($post->ID, 'jetpack-portfolio-tag', '<li class="label radius">', '</li><li class="label radius">', '</li>');
         }
         if ($tags_list) {
             echo '<ul class="tags-links">' . $tags_list . '</ul>';
             // WPCS: XSS OK.
         }
     }
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link">';
         comments_popup_link(esc_html__('Leave a comment', 'jinn'), esc_html__('1 Comment', 'jinn'), esc_html__('% Comments', 'jinn'));
         echo '</span>';
     }
 }
开发者ID:jekkilekki,项目名称:theme-jin,代码行数:35,代码来源:template-tags.php

示例9: directory_theme_entry_meta

function directory_theme_entry_meta()
{
    if (is_sticky() && is_home() && !is_paged()) {
        printf('<span class="sticky-post">%s</span>', __('Featured', 'directory-starter'));
    }
    $format = get_post_format();
    if (current_theme_supports('post-formats', $format)) {
        printf('<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', sprintf('<span class="screen-reader-text">%s </span>', _x('Format', 'Used before post format.', 'directory-starter')), esc_url(get_post_format_link($format)), get_post_format_string($format));
    }
    if (in_array(get_post_type(), array('post', 'attachment'))) {
        $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
        $time_string = sprintf($time_string, esc_attr(get_the_date('c')), get_the_date(), esc_attr(get_the_modified_date('c')), get_the_modified_date());
        printf('<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', _x('Posted on', 'Used before publish date.', 'directory-starter'), esc_url(get_permalink()), $time_string);
    }
    if ('post' == get_post_type()) {
        if (is_singular() || is_multi_author()) {
            printf('<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', _x('Author', 'Used before post author name.', 'directory-starter'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author());
        }
        $categories_list = get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'directory-starter'));
        if ($categories_list) {
            printf('<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Categories', 'Used before category names.', 'directory-starter'), $categories_list);
        }
        $tags_list = get_the_tag_list('', _x(', ', 'Used between list items, there is a space after the comma.', 'directory-starter'));
        if ($tags_list) {
            printf('<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Tags', 'Used before tag names.', 'directory-starter'), $tags_list);
        }
    }
    if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
        echo '<span class="comments-link">';
        comments_popup_link(__('Leave a comment', 'directory-starter'), __('1 Comment', 'directory-starter'), __('% Comments', 'directory-starter'));
        echo '</span>';
    }
}
开发者ID:mistergiri,项目名称:directory-starter,代码行数:33,代码来源:entrymeta.php

示例10: twentyseventeen_entry_footer

 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function twentyseventeen_entry_footer()
 {
     /* translators: used between list items, there is a space after the comma */
     $separate_meta = __(', ', 'twentyseventeen');
     // Get Categories for posts.
     $categories_list = get_the_category_list($separate_meta);
     // Get Tags for posts.
     $tags_list = get_the_tag_list('', $separate_meta);
     // We don't want to output .entry-footer if it will be empty, so make sure its not.
     if (twentyseventeen_categorized_blog() && $categories_list || $tags_list || get_edit_post_link()) {
         echo '<footer class="entry-footer">';
         if ('post' === get_post_type()) {
             if ($categories_list && twentyseventeen_categorized_blog() || $tags_list) {
                 echo '<span class="cat-tags-links">';
                 // Make sure there's more than one category before displaying.
                 if ($categories_list && twentyseventeen_categorized_blog()) {
                     echo '<span class="cat-links">' . twentyseventeen_get_svg(array('icon' => 'folder-open')) . '<span class="screen-reader-text">' . __('Categories', 'twentyseventeen') . '</span>' . $categories_list . '</span>';
                 }
                 if ($tags_list) {
                     echo '<span class="tags-links">' . twentyseventeen_get_svg(array('icon' => 'hashtag')) . '<span class="screen-reader-text">' . __('Tags', 'twentyseventeen') . '</span>' . $tags_list . '</span>';
                 }
                 echo '</span>';
             }
         }
         twentyseventeen_edit_link();
         echo '</footer> <!-- .entry-footer -->';
     }
 }
开发者ID:CompositeUK,项目名称:clone.WordPress-Develop,代码行数:31,代码来源:template-tags.php

示例11: material_blog_entry_footer

 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function material_blog_entry_footer()
 {
     // Hide category and tag text for pages.
     if ('post' === get_post_type()) {
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', 'material-blog'));
         if ($categories_list && material_blog_categorized_blog()) {
             printf('<span class="cat-links">' . esc_html__('%1$s', 'material-blog') . '</span>', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', 'material-blog'));
         if ($tags_list) {
             printf('<span class="tags-links">' . esc_html__('%1$s', 'material-blog') . '</span>', $tags_list);
             // WPCS: XSS OK.
         }
     }
     /*	if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
     		echo '<span class="comments-link">';
     		comments_popup_link( esc_html__( 'Leave a comment', 'material-blog' ), esc_html__( '1 Comment', 'material-blog' ), esc_html__( '% Comments', 'material-blog' ) );
     		echo '</span>';
     	}*/
     // the function used in the header part, this part copied out to the footer separately
     edit_post_link(sprintf(esc_html__('Edit %s', 'material-blog'), the_title('<span class="screen-reader-text">"', '"</span>', false)), '<span class="edit-link">', '</span>');
 }
开发者ID:yujinyan,项目名称:material-blog-theme,代码行数:28,代码来源:template-tags.php

示例12: sangeet_entry_footer

 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function sangeet_entry_footer()
 {
     // Hide category and tag text for pages.
     if ('post' === get_post_type()) {
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', 'sangeet'));
         if ($categories_list && sangeet_categorized_blog()) {
             printf('<span class="cat-links">' . esc_html__('%1$s', 'sangeet') . '</span>', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', 'sangeet'));
         if ($tags_list) {
             printf('<span class="tags-links">' . esc_html__('%1$s', 'sangeet') . '</span>', $tags_list);
             // WPCS: XSS OK.
         }
     }
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link">';
         comments_popup_link(esc_html__('Leave a comment', 'sangeet'), esc_html__('1 Comment', 'sangeet'), esc_html__('% Comments', 'sangeet'));
         echo '</span>';
     }
     edit_post_link(sprintf(esc_html__('Edit %s', 'sangeet'), the_title('<span class="screen-reader-text">"', '"</span>', false)), '<span class="edit-link">', '</span>');
     if (!is_single()) {
         echo '<span class="continue-reading"><a href="' . get_permalink() . '" title="' . esc_html__('Continue Reading ', 'sangeet') . get_the_title() . '" rel="bookmark">' . esc_html__('Continue Reading ', 'sangeet') . '</a></span>';
     }
 }
开发者ID:kirandash,项目名称:Sangeet,代码行数:30,代码来源:template-tags.php

示例13: chroma_entry_footer

 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function chroma_entry_footer()
 {
     // Hide category and tag text for pages.
     echo '<footer class="entry-footer">';
     if ('post' === get_post_type()) {
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', 'chroma'));
         if ($categories_list && chroma_categorized_blog()) {
             printf('<span class="cat-links"><i title="Categories..." class="fa fa-archive"></i>' . esc_html__(' %1$s', 'chroma') . '</span> ', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', 'chroma'));
         if ($tags_list) {
             printf('<span class="tags-links"><i title="Tags..." class="fa fa-hashtag"></i>' . esc_html__(' %1$s', 'chroma') . '</span> ', $tags_list);
             // WPCS: XSS OK.
         }
     }
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link"><i title="Comments..." class="fa fa-commenting"></i> ';
         comments_popup_link(esc_html__('Comment', 'chroma'), esc_html__('1 Comment', 'chroma'), esc_html__('% Comments', 'chroma'));
         echo '</span>';
     }
     /*	edit_post_link(
     		sprintf(
     			esc_html__( 'Edit %s', 'chroma' ),
     			the_title( '<span class="screen-reader-text">"', '"</span>', false )
     		),
     		'<span class="edit-link">',
     		'</span>'
     	);
     */
     echo '</footer><!-- .entry-footer -->';
 }
开发者ID:chromasites,项目名称:Chroma-Theme,代码行数:37,代码来源:template-tags.php

示例14: ocin_lite_metadata

 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function ocin_lite_metadata()
 {
     echo '<ul>';
     $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
     if (get_the_time('U') !== get_the_modified_time('U')) {
         $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
     }
     $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
     echo '<li class="meta_date">' . $time_string . '</li>';
     $byline = sprintf(esc_html_x('by %s', 'post author', 'ocin-lite'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>');
     echo '<li class="meta_comments">' . $byline . '</li>';
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<li class="meta_date"><span class="comments-link">';
         comments_popup_link(esc_html__('Leave a comment', 'ocin-lite'), esc_html__('1 Comment', 'ocin-lite'), esc_html__('% Comments', 'ocin-lite'));
         echo '</span></li>';
     }
     // Hide category and tag text for pages.
     if ('post' === get_post_type() && is_single()) {
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', 'ocin-lite'));
         if ($categories_list && ocin_lite_categorized_blog()) {
             printf('<li class="meta_categories"><span class="cat-links">' . esc_html__('Posted in %1$s', 'ocin-lite') . '</span></li>', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', 'ocin-lite'));
         if ($tags_list) {
             printf('<li class="meta_tags"><span class="tags-links">' . esc_html__('Tagged %1$s', 'ocin-lite') . '</span></li>', $tags_list);
             // WPCS: XSS OK.
         }
     }
     echo '</ul>';
 }
开发者ID:nicoandrade,项目名称:Ocin-Lite,代码行数:36,代码来源:template-tags.php

示例15: ving_entry_footer

 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function ving_entry_footer()
 {
     global $wp_query;
     // Hide category and tag text for pages.
     if ('post' === get_post_type()) {
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', 'ving'));
         if ($categories_list && ving_categorized_blog()) {
             $post = $wp_query->post;
             $cat = wp_get_post_terms($post->ID, 'category');
             $count = count($cat);
             if ($count > 1) {
                 printf('<span class="cat-links col-lg-6 col-md-6 col-sm-6 col-xs-12"><span class="text">CATEGORIES</span>' . esc_html__('%1$s', 'ving') . '</span>', $categories_list);
                 // WPCS: XSS OK.
             } else {
                 printf('<span class="cat-links col-lg-6 col-md-6 col-sm-6 col-xs-12"><span class="text">CATEGORY</span>' . esc_html__('%1$s', 'ving') . '</span>', $categories_list);
                 // WPCS: XSS OK.
             }
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', 'ving'));
         if ($tags_list) {
             printf('<span class="tags-links col-lg-5 col-md-5 col-sm-5 col-xs-12"><span class="text">TAGS</span>' . esc_html__('%1$s', 'ving') . '</span>', $tags_list);
             // WPCS: XSS OK.
         }
     }
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link">';
         comments_popup_link(esc_html__('Leave a comment', 'ving'), esc_html__('1 Comment', 'ving'), esc_html__('% Comments', 'ving'));
         echo '</span>';
     }
     edit_post_link(sprintf(esc_html__('Edit %s', 'ving'), the_title('<span class="screen-reader-text">"', '"</span>', false)), '<span class="edit-link">', '</span>');
 }
开发者ID:jasonralph,项目名称:jasonralph.org,代码行数:36,代码来源:template-tags.php


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