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

PHP get_comments_number函数代码示例

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

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



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


示例2: square_posted_on

 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function square_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(esc_html_x('%s', 'post date', 'square'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
     $byline = sprintf(esc_html_x('by %s', 'post author', 'square'), '<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>');
     $comment_count = get_comments_number();
     // get_comments_number returns only a numeric value
     if (comments_open()) {
         if ($comment_count == 0) {
             $comments = __('No Comments', 'square');
         } elseif ($comment_count > 1) {
             $comments = $comment_count . __(' Comments', 'square');
         } else {
             $comments = __('1 Comment', 'square');
         }
         $comment_link = '<a href="' . get_comments_link() . '">' . $comments . '</a>';
     } else {
         $comment_link = __(' Comment Closed', 'square');
     }
     echo '<span class="posted-on"><i class="fa fa-clock-o"></i>' . $posted_on . '</span><span class="byline"> ' . $byline . '</span><span class="comment-count"><i class="fa fa-comments-o"></i>' . $comment_link . "</span>";
     // WPCS: XSS OK.
 }
开发者ID:jgcopple,项目名称:drgaryschwantz,代码行数:29,代码来源:template-tags.php


示例3: flatbook_post_metas

 function flatbook_post_metas()
 {
     $user = get_the_author();
     $date = get_the_date('F j');
     $cats = get_the_category();
     $tags = get_the_tags();
     $comm = get_comments_number();
     $type = get_post_format();
     if (false === $type) {
         $type = __('standard', 'flatbook');
     }
     echo '<div class="entry-metas">';
     if ($type) {
         echo '<span class="format"><i class="fa fa-inbox"></i>' . $type . '</span>';
     }
     if ($date) {
         echo '<span class="posted-on"><i class="fa fa-dashboard"></i>' . $date . '</span>';
     }
     if ($user) {
         echo '<span class="byline"><i class="fa fa-user"></i>' . $user . '</span>';
     }
     if ($cats) {
         echo '<span class="cats"><i class="fa fa-folder-open"></i>' . $cats[0]->cat_name . '</span>';
     }
     if ($tags) {
         echo '<span class="tags"><i class="fa fa-tags"></i>' . $tags[0]->name . '</span>';
     }
     if ($comm) {
         echo '<span class="comments"><i class="fa fa-comments"></i>' . $comm . __(' Comment', 'flatbook') . '</span>';
     }
     echo '</div>';
 }
开发者ID:de190909,项目名称:WPTest,代码行数:32,代码来源:template-tags.php


示例4: 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()
 }
开发者ID:pleiadesdigital,项目名称:pleiadesweb,代码行数:29,代码来源:template-tags.php


示例5: wpsr_floatingbts_commentbt

function wpsr_floatingbts_commentbt($args)
{
    global $post;
    $defaults = array('type' => 'vertical');
    $args = wp_parse_args($args, $defaults);
    extract($args, EXTR_SKIP);
    $comments_num = get_comments_number();
    if (comments_open()) {
        if ($type == 'vertical') {
            return '<div class="wpsr_commentsbt">
				<div class="wpsr_cmt_bubble" title="Comments"><a href="' . get_comments_link() . '">' . $comments_num . '</a></div>
				<div class="wpsr_cmt_button"><a href="' . get_comments_link() . '">Comment</a></div>
			</div>';
        } else {
            if ($comments_num == 0) {
                $comments = __('No Comments');
            } elseif ($comments_num > 1) {
                $comments = $comments_num . __(' Comments');
            } else {
                $comments = __('1 Comment');
            }
            return '<a href="' . get_comments_link() . '">' . $comments . '</a>';
        }
    } else {
        return '';
    }
}
开发者ID:pankajsinghjarial,项目名称:SYLC-AMERICAN,代码行数:27,代码来源:wpsr-floatingbar.php


示例6: presscore_display_related_projects

 /**
  * Display related projects.
  *
  */
 function presscore_display_related_projects()
 {
     global $post;
     $html = '';
     $config = presscore_get_config();
     // if related projects turn on in theme options
     if ($config->get('post.related_posts.enabled')) {
         $terms = array();
         switch ($config->get('post.related_posts.query.mode')) {
             case 'custom':
                 $terms = $config->get('post.related_posts.query.terms');
                 break;
             default:
                 $terms = wp_get_object_terms($post->ID, 'dt_portfolio_category', array('fields' => 'ids'));
         }
         if ($terms && !is_wp_error($terms)) {
             $options = array('cats' => $terms, 'select' => 'only', 'post_type' => 'dt_portfolio', 'taxonomy' => 'dt_portfolio_category', 'args' => array('posts_per_page' => intval($config->get('post.related_posts.query.posts_per_page')), 'post__not_in' => array(get_the_ID())));
             $posts = presscore_get_posts_in_categories($options);
             $portfolio_scroller = new Presscore_Portfolio_Posts_Scroller();
             $portfolio_scroller->setup($posts, array('class' => 'related-projects slider-wrapper', 'width' => $config->get('post.related_posts.width'), 'height' => $config->get('post.related_posts.height'), 'show_title' => $config->get('post.related_posts.show.title'), 'show_excerpt' => $config->get('post.related_posts.show.description'), 'appearance' => 'under_image', 'padding' => 20, 'bg_under_projects' => false, 'content_aligment' => 'center', 'hover_animation' => 'fade', 'hover_bg_color' => 'accent', 'hover_content_visibility' => 'on_hoover', 'show_link' => $config->get('post.related_posts.show.link'), 'show_details' => $config->get('post.related_posts.show.details_link'), 'show_zoom' => $config->get('post.related_posts.show.zoom'), 'show_date' => $config->get('post.related_posts.meta.fields.date'), 'show_categories' => $config->get('post.related_posts.meta.fields.categories'), 'show_comments' => $config->get('post.related_posts.meta.fields.comments'), 'show_author' => $config->get('post.related_posts.meta.fields.author'), 'arrows' => 'accent'));
             $html .= $portfolio_scroller->get_html();
             if ($html) {
                 $html = '<div class="full-width-wrap">' . $html . '</div>';
                 // fancy separator
                 $html = presscore_fancy_separator(array('title' => $config->get('post.related_posts.title'), 'class' => 'fancy-projects-title')) . $html;
                 if (!(post_password_required() || !comments_open() && 0 == get_comments_number())) {
                     // add gap after projects
                     $html .= do_shortcode('[dt_gap height="40"]');
                 }
             }
         }
     }
     echo (string) apply_filters('presscore_display_related_projects', $html);
 }
开发者ID:noman90rauf,项目名称:wp-content,代码行数:38,代码来源:portfolio-helpers.php


示例7: 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


示例8: eighteen_tags_display_comments

 /**
  * Eighteen tags display comments
  * @since  1.0.0
  */
 function eighteen_tags_display_comments()
 {
     // If comments are open or we have at least one comment, load up the comment template
     if (comments_open() || '0' != get_comments_number()) {
         comments_template();
     }
 }
开发者ID:pootlepress,项目名称:18-tags,代码行数:11,代码来源:comments.php


示例9: vca_comments_template

function vca_comments_template()
{
    // If comments are open or we have at least one comment, load up the comment template
    if (CA_Option::get('enable_comments', true) && (comments_open() || '0' != get_comments_number())) {
        comments_template();
    }
}
开发者ID:justnorris,项目名称:village-client-area,代码行数:7,代码来源:functions.php


示例10: hacker_entry_footer

    /**
     * Prints HTML with meta information for the categories, tags and comments.
     */
    function hacker_entry_footer()
    {
        // Hide category and tag text for pages.
        ?>
	<div class="Article__meta pull-left">
	<?php 
        if ('post' === get_post_type()) {
            echo get_the_tag_list('<span class="post-tags"><i class="icon-tags"></i>', '', '</span>');
        }
        ?>
	</div>
	<!-- END .pull-left -->
	<div class="Article__meta pull-right">
	<?php 
        $post_id = get_the_ID();
        $likes = get_post_meta($post_id, '_likes', true);
        $likes = absint($likes);
        printf('<span><a href="#" class="js-rating" data-post="%1$s"><i class="icon-heart"></i><span class="js-count">%2$s</span></a></span>', $post_id, $likes);
        if (!post_password_required() && (comments_open() || get_comments_number())) {
            echo '<span><i class="icon-comments"></i><span>';
            comments_popup_link(esc_html__('No Comment', 'hacker'), esc_html__('1 Comment', 'hacker'), esc_html__('% Comments', 'hacker'));
            echo '</span></span>';
        }
        ?>
	</div>
	<!-- END .pull-right -->
<?php 
    }
开发者ID:yanvalue,项目名称:wordpress,代码行数:31,代码来源:template-tags.php


示例11: hocwp_theme_check_load_facebook_javascript_sdk

function hocwp_theme_check_load_facebook_javascript_sdk($use)
{
    $data = apply_filters('hocwp_load_facebook_javascript_sdk_on_page_sidebar', array());
    foreach ($data as $value) {
        $conditional_functions = isset($value['condition']) ? $value['condition'] : '';
        $conditional_functions = hocwp_sanitize_array($conditional_functions);
        $condition_result = false;
        foreach ($conditional_functions as $function) {
            if (!hocwp_callback_exists($function)) {
                continue;
            }
            if (call_user_func($function)) {
                $condition_result = true;
                break;
            }
        }
        $sidebar = isset($value['sidebar']) ? $value['sidebar'] : '';
        $sidebars = hocwp_sanitize_array($sidebar);
        foreach ($sidebars as $sidebar) {
            if (is_active_sidebar($sidebar) && $condition_result && hocwp_sidebar_has_widget($sidebar, 'hocwp_widget_facebook_box')) {
                return true;
            }
        }
    }
    $comment_system = hocwp_theme_get_option('comment_system', 'discussion');
    if ('facebook' == $comment_system || 'default_and_facebook' == $comment_system || 'tabs' == $comment_system) {
        if (is_singular()) {
            $post_id = get_the_ID();
            if (comments_open($post_id) || get_comments_number($post_id)) {
                return true;
            }
        }
    }
    return $use;
}
开发者ID:skylarkcob,项目名称:hocwp-projects,代码行数:35,代码来源:setup-theme-after.php


示例12: 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


示例13: k2_asides_permalink

function k2_asides_permalink($content)
{
    if (in_category(get_option('unwakeable_asidescategory')) and !is_singular()) {
        $content .= '<a href="' . get_permalink() . '" rel="bookmark" class="asides-permalink" title="' . k2_permalink_title(false) . '">(' . get_comments_number() . ')</a>';
    }
    return $content;
}
开发者ID:r15ch13,项目名称:unwakeable,代码行数:7,代码来源:display.php


示例14: 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


示例15: 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


示例16: add_shortcode_blog

function add_shortcode_blog($atts)
{
    extract(shortcode_atts(array('categories' => '', 'count' => 4), $atts));
    $output = '';
    $output .= '<div class="blog-post-shortcode">';
    $i = 0;
    $args = array("post_type" => "post", "posts_per_page" => $count, "cat" => $categories);
    query_posts($args);
    while (have_posts()) {
        the_post();
        $output .= '<div class="post-home three columns">';
        $output .= '<div class="post-format-wrap">';
        $output .= tf_get_post_format(array('image' => array('width' => 420, 'height' => 290), 'gallery' => array('width' => 420, 'height' => 290), 'video' => array('width' => 420, 'height' => 290)));
        $output .= '</div>';
        $output .= '<h4><a href="' . get_permalink() . '">' . get_the_title() . '</a></h4>';
        $output .= '<div>' . get_the_date('d M, Y') . ' &nbsp;-&nbsp; ' . get_comments_number() . ' ' . __('comments', THEME_SLUG) . '</div>';
        $output .= '<p>' . tf_the_excerpt_max_charlength(120) . '</p>';
        $output .= '</div>';
    }
    wp_reset_query();
    wp_reset_postdata();
    $output .= '</div>';
    $output .= '<div class="clear"></div>';
    return $output;
}
开发者ID:brycefrees,项目名称:nddLive,代码行数:25,代码来源:blog.php


示例17: moderna_tag_comment

 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function moderna_tag_comment()
 {
     // 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__(', ', 'moderna'));
                       if ($categories_list && moderna_categorized_blog()) {
                           printf('<span class="cat-links">' . esc_html__('Posted in %1$s', 'moderna') . '</span>', $categories_list); // WPCS: XSS OK.
                       }*/
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', '<div style="float: left;">,&nbsp;</div>');
         printf('<li><i class="icon-folder-open"></i>' . esc_html__('%1$s', 'moderna') . '</li>', $tags_list);
         // WPCS: XSS OK.
     }
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<li><i class="icon-comments"></i>';
         comments_popup_link(esc_html__('No comments', 'moderna'), esc_html__('1 Comment', 'moderna'), esc_html__('% Comments', 'moderna'));
         echo '</li>';
     }
     /*
                          edit_post_link(
                              sprintf(
                              // translators: %s: Name of current post
                                  esc_html__('Edit %s', 'moderna'),
                                  the_title('<span class="screen-reader-text">"', '"</span>', false)
                              ),
                              '<span class="edit-link">',
                              '</span>'
                          );*/
 }
开发者ID:nordcap,项目名称:wp_template_moderna,代码行数:33,代码来源:template-tags.php


示例18: 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.
     */
 }
开发者ID:vfedushchin,项目名称:Tm-kursi-theme,代码行数:29,代码来源:template-tags.php


示例19: amnesty_entry_footer

 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function amnesty_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__('', 'amnesty'));
         if ($categories_list && amnesty_categorized_blog()) {
             printf('<span class="cat-links"><h2>' . esc_html__('Posted in', 'amnesty') . '</h2>%1$s</span>', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('<li>', '</li><li>', '</li>');
         if ($tags_list) {
             printf('<span class="tags-links"><h2>' . esc_html__('Tagged', 'amnesty') . '</h2><ul>%1$s</ul></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', 'amnesty'), esc_html__('1 Comment', 'amnesty'), esc_html__('% Comments', 'amnesty'));
         echo '</span>';
     }
     //    edit_post_link(
     //        sprintf(
     //        /* translators: %s: Name of current post */
     //            esc_html__('Edit %s', 'amnesty'),
     //            the_title('<span class="screen-reader-text">"', '"</span>', false)
     //        ),
     //        '<span class="edit-link">',
     //        '</span>'
     //    );
 }
开发者ID:spielhoelle,项目名称:amnesty,代码行数:35,代码来源:template-tags.php


示例20: 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>';
    }
}
开发者ID:vonkanehoffen,项目名称:kanec-wp-theme,代码行数:34,代码来源:template-tags.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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