本文整理汇总了PHP中comments_popup_link函数的典型用法代码示例。如果您正苦于以下问题:PHP comments_popup_link函数的具体用法?PHP comments_popup_link怎么用?PHP comments_popup_link使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了comments_popup_link函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: twentysixteen_entry_meta
function twentysixteen_entry_meta()
{
ob_start();
if ('post' === get_post_type()) {
ob_start();
twentysixteen_entry_date();
$postedOn = ob_get_clean();
$author_avatar_size = apply_filters('twentysixteen_author_avatar_size', 49);
printf('<div class="name-date"><div class="name"><span class="screen-reader-text">%2$s </span> <a class="url fn n" href="%3$s">%4$s</a></div><div class="date">%5$s</div></div><div class="avatar">%1$s</div>', get_avatar(get_the_author_meta('user_email'), $author_avatar_size), _x('Author', 'Used before post author name.', 'twentysixteen'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author(), $postedOn);
}
if (in_array(get_post_type(), array('attachment'))) {
twentysixteen_entry_date();
}
$authordate = ob_get_clean();
printf('<div class="author-date">%s</div>', $authordate);
$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.', 'twentysixteen')), esc_url(get_post_format_link($format)), get_post_format_string($format));
}
echo '<div class="taxonomies">';
if ('post' === get_post_type()) {
twentysixteen_entry_taxonomies();
}
echo '</div>';
if (!is_singular() && !post_password_required() && (comments_open() || get_comments_number())) {
echo '<span class="comments-link">';
comments_popup_link(sprintf(__('Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentysixteen'), get_the_title()));
echo '</span>';
}
}
示例2: child_theme_do_post_info_comments
function child_theme_do_post_info_comments()
{
if (get_theme_mod('disable_comments_meta', 0)) {
return;
}
comments_popup_link(false, false, false, 'comments-link');
}
示例3: 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>';
}
}
示例4: wpex_entry_meta
function wpex_entry_meta()
{
?>
<ul class="loop-entry-meta clearfix">
<li class="meta-date"><span class="fa fa-calendar"></span><?php
echo get_the_date();
?>
</li>
<?php
if (comments_open()) {
?>
<li class="meta-comments"><span class="fa fa-comment"></span> <?php
comments_popup_link(__('0 comments', 'wpex'), __('1 comment', 'wpex'), __('% comments', 'wpex'), 'comments-link', __('comments closed', 'wpex'));
?>
</li>
<?php
}
?>
<?php
if (function_exists('zilla_likes')) {
?>
<li class="meta-zilla-likes"><?php
zilla_likes();
?>
</li><?php
}
?>
</ul> <!-- /loop-entry-meta -->
<?php
}
示例5: pleiadesweb_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function pleiadesweb_posted_on()
{
// POSTED ON
$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()));
$posted_on = sprintf('<i class="fa fa-calendar"></i>' . esc_html_x(' %s', 'post date', 'pleiadesweb'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
// AUTHOR
$byline = sprintf(esc_html_x('| escrito por %s', 'post author', 'pleiadesweb'), '<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="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>';
// CATEGORIES
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list(esc_html__(', ', 'pleiadesweb'));
if ($categories_list && pleiadesweb_categorized_blog()) {
echo ' | </i><span class="category-list">' . $categories_list . '</span>';
}
// COMMENTS
if (!post_password_required() && (comments_open() || '0' != get_comments_number())) {
echo ' | <span class="comments-link">';
comments_popup_link(__('Deja un comentario', 'my-simone'), __('1 comentario', 'my-simone'), __('% comentarios', 'my-simone'));
echo '</span>';
}
//!post_password_required()
}
示例6: ultra_posted_on
/**
* Prints HTML with meta information for the current post-date/time, author, comment count and categories.
*/
function ultra_posted_on()
{
echo '<div class="entry-meta-inner">';
if (is_sticky() && is_home() && !is_paged()) {
echo '<span class="featured-post">' . __('Sticky', 'ultra') . '</span>';
}
if (is_home() && siteorigin_setting('blog_post_date') || is_archive() && siteorigin_setting('blog_post_date') || is_search() && siteorigin_setting('blog_post_date')) {
echo '<span class="entry-date"><a href="' . esc_url(get_permalink()) . '" rel="bookmark"><time class="published" datetime="' . esc_attr(get_the_date('c')) . '">' . esc_html(get_the_date('j F Y')) . '</time><time class="updated" datetime="' . esc_attr(get_the_modified_date('c')) . '">' . esc_html(get_the_modified_date()) . '</time></span></a>';
}
if (is_single() && siteorigin_setting('blog_post_date')) {
echo '<span class="entry-date"><time class="published" datetime="' . esc_attr(get_the_date('c')) . '">' . esc_html(get_the_date('j F Y')) . '</time><time class="updated" datetime="' . esc_attr(get_the_modified_date('c')) . '">' . esc_html(get_the_modified_date()) . '</time></span>';
}
if (siteorigin_setting('blog_post_author')) {
echo '<span class="byline"><span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '" rel="author">' . esc_html(get_the_author()) . '</a></span></span>';
}
if (comments_open() && siteorigin_setting('blog_post_comment_count')) {
echo '<span class="comments-link">';
comments_popup_link(__('Leave a comment', 'ultra'), __('1 Comment', 'ultra'), __('% Comments', 'ultra'));
echo '</span>';
}
echo '</div>';
if (is_single() && siteorigin_setting('navigation_post_nav')) {
the_post_navigation($args = array('prev_text' => '', 'next_text' => ''));
}
}
示例7: tm_vals_blog_posted_on
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function tm_vals_blog_posted_on()
{
$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()));
// comments in header
if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
echo '<span class="comments-link">';
comments_popup_link(esc_html__('Leave a comment', 'tm-vals-blog'), esc_html__('1', 'tm-vals-blog'), esc_html__('%', 'tm-vals-blog'));
echo '</span>';
}
/* $posted_on = sprintf(
esc_html_x( 'Posted on %s', 'post date', 'tm-vals-blog' ),
'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
);
$byline = sprintf(
esc_html_x( 'by %s', 'post author', 'tm-vals-blog' ),
'<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="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK.
*/
}
示例8: 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>';
}
示例9: wpex_post_meta
function wpex_post_meta()
{
?>
<section class="meta clearfix" id="single-meta">
<ul>
<li class="meta-single-date"><span class="fa fa-calendar"></span><?php
the_date();
?>
</li>
<?php
if (comments_open()) {
?>
<li class="comment-scroll meta-single-comments"><span class="fa fa-comment"></span> <?php
comments_popup_link(__('Leave a comment', 'wpex'), __('1 Comment', 'wpex'), __('% Comments', 'wpex'), 'comments-link', __('Comments closed', 'wpex'));
?>
</li>
<?php
}
?>
<?php
if (function_exists('zilla_likes')) {
?>
<li class="meta-single-zilla-likes"><?php
zilla_likes();
?>
</li><?php
}
?>
</ul>
</section><!--/meta -->
<?php
}
示例10: kanec_entry_meta
/**
* This is a duplicate of the above. Probably delete others
*/
function kanec_entry_meta()
{
// Time
$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 '<div class="posted-on"><i class="icon icon-calendar-o"></i><a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a></div>';
// Author
echo '<div class="byline"><i class="icon icon-user"></i><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></div>';
// Categories & Tags
// 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__(', ', 'kanec'));
if ($categories_list && kanec_categorized_blog()) {
echo '<div class="cat-links"><i class="icon icon-folder-open"></i>' . $categories_list . '</div>';
}
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list('', esc_html__(', ', 'kanec'));
if ($tags_list) {
echo '<div class="tags-links"><i class="icon icon-tags"></i>' . $tags_list . '</div>';
}
}
if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
echo '<div class="comments-link"><i class="icon icon-comments"></i>';
comments_popup_link(esc_html__('Leave a comment', 'kanec'), esc_html__('1 Comment', 'kanec'), esc_html__('% Comments', 'kanec'));
echo '</div>';
}
}
示例11: twentyten_posted_on
function twentyten_posted_on()
{
$meta = array();
$meta['author'] = sprintf(__('%1$s <span class="meta-sep">by</span> %2$s', 'wordcampbase'), sprintf('<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>', get_permalink(), esc_attr(get_the_time()), get_the_date()), 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', 'wordcampbase'), get_the_author()), get_the_author()));
$meta['sep'] = ' <span class="meta-sep meta-sep-bull">•</span> ';
$meta['comments'] = array('before' => '<span class="comments-link">', 'after' => '</span>', 'zero' => __('Leave a comment', 'wordcampbase'), 'one' => __('1 Comment', 'wordcampbase'), 'many' => __('% Comments', 'wordcampbase'));
$meta['edit'] = array('title' => __('Edit', 'wordcampbase'), 'before' => '<span class="edit-link">', 'after' => '</span>');
$meta['br'] = '<br />';
// Just to have.
$meta['order'] = array('author', 'sep', 'comments', 'edit');
$meta = apply_filters('wcb_entry_meta', $meta);
if (!is_array($meta) || !isset($meta['order'])) {
return;
}
foreach ($meta['order'] as $type) {
$content = $meta[$type];
switch ($type) {
case 'comments':
echo $content['before'];
comments_popup_link($content['zero'], $content['one'], $content['many']);
echo $content['after'];
break;
case 'edit':
if (isset($meta['sep'])) {
$content['before'] = $meta['sep'] . $content['before'];
}
edit_post_link($content['title'], $content['before'], $content['after']);
break;
default:
echo $content;
}
}
}
示例12: dynamicnews_display_postmeta
function dynamicnews_display_postmeta()
{
?>
<span class="meta-date">
<?php
printf(__('<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date published updated" datetime="%3$s">%4$s</time></a>', 'dynamicnewslite'), esc_url(get_permalink()), esc_attr(get_the_time()), esc_attr(get_the_date('c')), esc_html(get_the_date()));
?>
</span>
<span class="meta-author sep">
<?php
printf(__('<span class="author vcard"><a class="fn" href="%1$s" title="%2$s" rel="author">%3$s</a></span>', 'dynamicnewslite'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'dynamicnewslite'), get_the_author())), get_the_author());
?>
</span>
<?php
if (comments_open()) {
?>
<span class="meta-comments sep">
<?php
comments_popup_link(__('Leave a comment', 'dynamicnewslite'), __('One comment', 'dynamicnewslite'), __('% comments', 'dynamicnewslite'));
?>
</span>
<?php
}
?>
<?php
edit_post_link(__('Edit Post', 'dynamicnewslite'));
}
示例13: 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>'
// );
}
示例14: rambo_post_meta_content
function rambo_post_meta_content()
{
?>
<div class="blog_section2_comment">
<a href="<?php
the_permalink();
?>
"><i class="fa fa-calendar icon-spacing"></i><?php
the_time(get_option('date_format'));
?>
</a>
<a href="<?php
the_permalink();
?>
"><i class="fa fa-comments icon-spacing"></i><?php
comments_popup_link(__('leave a comment', 'rambo'));
?>
</a>
<a href="<?php
echo get_author_posts_url(get_the_author_meta('ID'));
?>
"><i class="fa fa-user icon-spacing"></i> <?php
_e("By", 'rambo');
?>
<?php
the_author();
?>
</a>
</div>
<?php
}
示例15: 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>';
}
}