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


PHP comments_link函数代码示例

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


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

示例1: restful_post_meta_above

/**
 * Post meta for above the post.
 */
function restful_post_meta_above()
{
    global $post;
    ?>

  <div class="entry__meta-item">
    <i class="fa fa-calendar"></i>
    <a href="<?php 
    esc_url(get_permalink());
    ?>
"><?php 
    the_time(get_option('date_format'));
    ?>
</a>
  </div>

  <div class="entry__meta-item">
    <i class="fa fa-user"></i>
    <a href="<?php 
    echo esc_url(get_author_posts_url($post->post_author));
    ?>
"><?php 
    the_author_meta('display_name', $post->post_author);
    ?>
</a>
  </div>

  <?php 
    if (comments_open() || have_comments()) {
        ?>
    <div class="entry__meta-item">
      <i class="fa fa-comment"></i>
      <a href="<?php 
        esc_url(comments_link());
        ?>
"><?php 
        comments_number();
        ?>
</a>
    </div>
  <?php 
    }
    ?>

<?php 
}
开发者ID:themebright,项目名称:Restful,代码行数:49,代码来源:template-tags.php

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

示例3: widget

        function widget($args, $instance)
        {
            extract($args);
            $title = apply_filters('widget_title', $instance['title']);
            echo $before_widget;
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            ?>

		    	<ul class="post-list">
			    	<?php 
            query_posts('post_type=post&posts_per_page=' . $instance['amount'] . '&orderby=comment_count&order=DESC');
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    ?>
			    	
			    	<li>
			    		<figure class="frame pull-left">
			    		  <div class="icon-overlay"><a href="<?php 
                    the_permalink();
                    ?>
"><span class="icn-more"></span><?php 
                    the_post_thumbnail('thumbnail');
                    ?>
 </a></div>
			    		</figure>
			    		<div class="meta"> <em><span class="date"><?php 
                    the_time(get_option('date_format'));
                    ?>
 </span>
			    		<span class="comments"><a href="<?php 
                    comments_link();
                    ?>
"><?php 
                    comments_number('0', '1', '%');
                    ?>
 <i class="icon-chat-1"></i></a></span></em>
			    		  <h5><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h5>
			    		</div>
			    	</li>
			    	              
			    	<?php 
                }
            }
            wp_reset_query();
            ?>
		    	</ul>
			
			<?php 
            echo $after_widget;
        }
开发者ID:gabriel-dehan,项目名称:erdf-sessions,代码行数:59,代码来源:lumos-widgets.php

示例4: comments_popup_link

function comments_popup_link($zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $CSSclass = '', $none = 'Comments Off')
{
    global $wp_post_id, $wpcommentspopupfile, $wpcommentsjavascript, $post, $wpdb, $cookiehash, $wp_id;
    global $siteurl, $wp_mod;
    global $comment_count_cache;
    if (get_xoops_option($wp_mod[$wp_id], 'wp_use_xoops_comments') == 0) {
        if ('' == $comment_count_cache[$wp_id]["{$wp_post_id}"]) {
            $number = $wpdb->get_var("SELECT COUNT(comment_ID) FROM {$wpdb->comments[$wp_id]} WHERE comment_post_ID = {$wp_post_id} AND comment_approved = '1';");
        } else {
            $number = $comment_count_cache[$wp_id]["{$wp_post_id}"];
        }
    } else {
        $number = $wpdb->get_var("SELECT COUNT(comment_ID) FROM {$wpdb->comments[$wp_id]} WHERE comment_post_ID = {$wp_post_id} AND comment_approved = '1' AND (comment_content like '<trackback />%' OR comment_content like '<pingkback />%');");
    }
    if (0 == $number && 'closed' == $post->comment_status && 'closed' == $post->ping_status) {
        echo $none;
        return;
    } else {
        if (!empty($post->post_password)) {
            // if there's a password
            if ($_COOKIE['wp-postpass_' . $cookiehash] != $post->post_password) {
                // and it doesn't match the cookie
                echo "Enter your password to view comments";
                return;
            }
        }
        echo '<a href="';
        if ($wpcommentsjavascript) {
            echo $siteurl . '/' . $wpcommentspopupfile . '?p=' . $wp_post_id . '&amp;c=1';
            //echo get_permalink();
            echo '" onclick="wpopen(this.href); return false"';
        } else {
            // if comments_popup_script() is not in the template, display simple comment link
            comments_link();
            echo '"';
        }
        if (!empty($CSSclass)) {
            echo ' class="' . $CSSclass . '"';
        }
        echo '>';
        comments_number($zero, $one, $more, $number);
        echo '</a>';
    }
}
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:44,代码来源:template-functions-comment.php

示例5: mom_news_boxes


//.........这里部分代码省略.........
                                <?php 
                    if (mom_post_image() != false) {
                        $mom_class = ' class="fix-right-content"';
                    } else {
                        $mom_class = '';
                    }
                    ?>
                                <div<?php 
                    echo $mom_class;
                    ?>
>
                                	<?php 
                    if ($post_head != 0) {
                        ?>
	                                <div class="entry-meta">
	                                <?php 
                        if ($post_head_date != 0) {
                            ?>
	                                    <time class="entry-date" datetime="<?php 
                            the_time('c');
                            ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                            mom_date_format();
                            ?>
</time>
	                                    <?php 
                        }
                        ?>
	                                    <?php 
                        if ($post_head_commetns != 0) {
                            ?>
	                                    <div class="comments-link">
	                                        <i class="momizat-icon-bubbles4"></i><a href="<?php 
                            comments_link();
                            ?>
"><?php 
                            comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                            ?>
</a>
	                                    </div>
	                                    <?php 
                        }
                        ?>
	                                </div>
	                                <?php 
                    }
                    ?>
	                                <h2 itemprop="name"><a itemprop="url" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
	                                <div class="entry-content">
	                                <?php 
                    if ($nb_excerpt != '0') {
                        ?>
  
	                                    <p>
	                                        <?php 
                        global $post;
                        $excerpt = $post->post_excerpt;
                        if ($excerpt == '') {
                            $excerpt = get_the_content('');
                        }
开发者ID:justinwool,项目名称:vortago,代码行数:67,代码来源:news-boxes.php

示例6: comments_popup_link

/**
 * Displays the link to the comments popup window for the current post ID.
 *
 * Is not meant to be displayed on single posts and pages. Should be used
 * on the lists of posts
 *
 * @global string $wpcommentspopupfile The URL to use for the popup window.
 * @global int $wpcommentsjavascript Whether to use JavaScript. Set when function is called.
 *
 * @since 0.71
 *
 * @param string $zero Optional. String to display when no comments. Default false.
 * @param string $one Optional. String to display when only one comment is available.
 *                          Default false.
 * @param string $more Optional. String to display when there are more than one comment.
 *                          Default false.
 * @param string $css_class Optional. CSS class to use for comments. Default empty.
 * @param string $none Optional. String to display when comments have been turned off.
 *                          Default false.
 */
function comments_popup_link($zero = false, $one = false, $more = false, $css_class = '', $none = false)
{
    global $wpcommentspopupfile, $wpcommentsjavascript;
    $id = get_the_ID();
    $title = get_the_title();
    $number = get_comments_number($id);
    if (false === $zero) {
        /* translators: %s: post title */
        $zero = sprintf(__('No Comments<span class="screen-reader-text"> on %s</span>'), $title);
    }
    if (false === $one) {
        /* translators: %s: post title */
        $one = sprintf(__('1 Comment<span class="screen-reader-text"> on %s</span>'), $title);
    }
    if (false === $more) {
        /* translators: 1: Number of comments 2: post title */
        $more = _n('%1$s Comment<span class="screen-reader-text"> on %2$s</span>', '%1$s Comments<span class="screen-reader-text"> on %2$s</span>', $number);
        $more = sprintf($more, number_format_i18n($number), $title);
    }
    if (false === $none) {
        /* translators: %s: post title */
        $none = sprintf(__('Comments Off<span class="screen-reader-text"> on %s</span>'), $title);
    }
    if (0 == $number && !comments_open() && !pings_open()) {
        echo '<span' . (!empty($css_class) ? ' class="' . esc_attr($css_class) . '"' : '') . '>' . $none . '</span>';
        return;
    }
    if (post_password_required()) {
        _e('Enter your password to view comments.');
        return;
    }
    echo '<a href="';
    if ($wpcommentsjavascript) {
        if (empty($wpcommentspopupfile)) {
            $home = home_url();
        } else {
            $home = get_option('siteurl');
        }
        echo $home . '/' . $wpcommentspopupfile . '?comments_popup=' . $id;
        echo '" onclick="wpopen(this.href); return false"';
    } else {
        // if comments_popup_script() is not in the template, display simple comment link
        if (0 == $number) {
            echo get_permalink() . '#respond';
        } else {
            comments_link();
        }
        echo '"';
    }
    if (!empty($css_class)) {
        echo ' class="' . $css_class . '" ';
    }
    $attributes = '';
    /**
     * Filter the comments popup link attributes for display.
     *
     * @since 2.5.0
     *
     * @param string $attributes The comments popup link attributes. Default empty.
     */
    echo apply_filters('comments_popup_link_attributes', $attributes);
    echo '>';
    comments_number($zero, $one, $more);
    echo '</a>';
}
开发者ID:richardbota,项目名称:WordPress-Theme-Development-with-Bootstrap,代码行数:85,代码来源:comment-template.php

示例7: ts_post_list_func


//.........这里部分代码省略.........
                ?>

							<div class="carousel-box load" data-carousel-pagination="<?php 
                echo $carousel_pagination == 'yes' ? 'true' : 'false';
                ?>
" data-carousel-nav="<?php 
                echo $carousel_navigation == 'yes' ? 'true' : 'false';
                ?>
" data-carousel-one="true">
								<div class="carousel"> 
									<?php 
                echo $slider;
                ?>
								</div>
								<div class="nav-box">
									<a class="next" href="#">
										<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="9px" height="16px" viewBox="0 0 9 16" enable-background="new 0 0 9 16" xml:space="preserve">
											<polygon fill-rule="evenodd" clip-rule="evenodd" fill="#fcfcfc" points="1,0.001 0,1.001 7,8 0,14.999 1,15.999 9,8 "></polygon>
										</svg>
									</a>
									<a class="prev" href="#">
										<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="9px" height="16px" viewBox="0 0 9 16" enable-background="new 0 0 9 16" xml:space="preserve">
											<polygon fill-rule="evenodd" clip-rule="evenodd" fill="#fcfcfc" points="8,15.999 9,14.999 2,8 9,1.001 8,0.001 0,8 "></polygon>
										</svg>
									</a>
								</div>
								<div class="clearfix"></div>
								<div class="pagination switches"></div>
							</div>
						<?php 
            } else {
                ?>
							<img src="<?php 
                echo esc_url(get_xv_thumbnail(370, 270));
                ?>
" class="single-image" />
						<?php 
            }
            ?>
					</div>

					<div class="col-xs-12 col-sm-8 col-md-8">
						<h2 class="entry-title"><a href="<?php 
            echo esc_url(get_the_permalink());
            ?>
" title="<?php 
            echo esc_attr(get_the_title());
            ?>
"><?php 
            the_title();
            ?>
</a></h2>
						<div class="entry-content">
							<?php 
            ts_the_excerpt_theme(155);
            ?>
						</div>

						<div class="entry-meta">
							<span class="autor-name"><?php 
            the_author();
            ?>
</span>,
							<span class="time"><?php 
            the_time('j.m.Y');
            ?>
</span>
							<span class="separator">|</span>
							<span class="meta"><?php 
            _e('Posted in', 'progressive');
            ?>
 <?php 
            echo get_the_category_list(', ');
            ?>
</span>
							<span class="comments-link pull-right">
								<a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number('0', '1', '%');
            ?>
 <?php 
            _e('comment(s)', 'progressive');
            ?>
</a>
							</span>
						</div>
					</div>
					<div class="clearfix"></div>
				</div><!-- .post -->
			</div>
			<?php 
        }
        wp_reset_postdata();
    }
    $html = ob_get_contents();
    ob_end_clean();
    return $html;
}
开发者ID:Sibzsolutions,项目名称:Schiffrinpa,代码行数:101,代码来源:post_list.php

示例8: comments_popup_link

/**
 * Displays the link to the comments popup window for the current post ID.
 *
 * Is not meant to be displayed on single posts and pages. Should be used on the
 * lists of posts
 *
 * @since 0.71
 * @uses $id
 * @uses $wpcommentspopupfile
 * @uses $wpcommentsjavascript
 * @uses $post
 *
 * @param string $zero The string to display when no comments
 * @param string $one The string to display when only one comment is available
 * @param string $more The string to display when there are more than one comment
 * @param string $css_class The CSS class to use for comments
 * @param string $none The string to display when comments have been turned off
 * @return null Returns null on single posts and pages.
 */
function comments_popup_link($zero = false, $one = false, $more = false, $css_class = '', $none = false)
{
    global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post;
    if (false === $zero) {
        $zero = __('No Comments');
    }
    if (false === $one) {
        $one = __('1 Comment');
    }
    if (false === $more) {
        $more = __('% Comments');
    }
    if (false === $none) {
        $none = __('Comments Off');
    }
    $number = get_comments_number($id);
    if (0 == $number && !comments_open() && !pings_open()) {
        echo '<span' . (!empty($css_class) ? ' class="' . esc_attr($css_class) . '"' : '') . '>' . $none . '</span>';
        return;
    }
    if (post_password_required()) {
        echo __('Enter your password to view comments');
        return;
    }
    echo '<a href="';
    if ($wpcommentsjavascript) {
        if (empty($wpcommentspopupfile)) {
            $home = get_option('home');
        } else {
            $home = get_option('siteurl');
        }
        echo $home . '/' . $wpcommentspopupfile . '?comments_popup=' . $id;
        echo '" onclick="wpopen(this.href); return false"';
    } else {
        // if comments_popup_script() is not in the template, display simple comment link
        if (0 == $number) {
            echo get_permalink() . '#respond';
        } else {
            comments_link();
        }
        echo '"';
    }
    if (!empty($css_class)) {
        echo ' class="' . $css_class . '" ';
    }
    $title = esc_attr(get_the_title());
    echo apply_filters('comments_popup_link_attributes', '');
    echo ' title="' . esc_attr(sprintf(__('Comment on %s'), $title)) . '">';
    comments_number($zero, $one, $more, $number);
    echo '</a>';
}
开发者ID:klr2003,项目名称:sourceread,代码行数:70,代码来源:comment-template.php

示例9: do_action

	<?php do_action('rss2_ns'); ?>
>

<channel>
	<title><?php bloginfo_rss('name'); ?></title>
	<link><?php bloginfo_rss('url') ?></link>
	<description><?php bloginfo_rss("description") ?></description>
	<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate>
	<generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator>
	<language><?php echo get_option('rss_language'); ?></language>
	<?php do_action('rss2_head'); ?>
	<?php while( have_posts()) : the_post(); ?>
	<item>
		<title><?php the_title_rss() ?></title>
		<link><?php permalink_single_rss() ?></link>
		<comments><?php comments_link(); ?></comments>
		<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
		<dc:creator><?php the_author() ?></dc:creator>
		<?php the_category_rss() ?>

		<guid isPermaLink="false"><?php the_guid(); ?></guid>
<?php if (get_option('rss_use_excerpt')) : ?>
		<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
<?php else : ?>
		<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
	<?php if ( strlen( $post->post_content ) > 0 ) : ?>
		<content:encoded><![CDATA[<?php the_content() ?>]]></content:encoded>
	<?php else : ?>
		<content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
	<?php endif; ?>
<?php endif; ?>
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:wp-rss2.php

示例10: mom_nb_show_more


//.........这里部分代码省略.........
                    the_permalink();
                    ?>
">
<?php 
                    mom_post_image_full('nb1-thumb');
                    ?>
<span class="post-format-icon"></span>
</a></figure>
<?php 
                }
                if (mom_post_image() != false) {
                    $mom_class = ' class="fix-right-content"';
                } else {
                    $mom_class = '';
                }
                ?>
<div<?php 
                echo $mom_class;
                ?>
>
<?php 
                if ($hpmeta == 1) {
                    ?>
<div class="entry-meta">
<time class="entry-date" datetime="<?php 
                    the_time('c');
                    ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                    mom_date_format();
                    ?>
</time>
<div class="comments-link">
<i class="momizat-icon-bubbles4"></i><a href="<?php 
                    comments_link();
                    ?>
"><?php 
                    comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                    ?>
</a>
</div>
</div>
<?php 
                }
                ?>
<h2 itemprop="name"><a itemprop="url" href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
<div class="entry-content">
<?php 
                if ($nb_excerpt != '0') {
                    ?>
  
<p>
<?php 
                    global $post;
                    $excerpt = $post->post_excerpt;
                    if ($excerpt == '') {
                        $excerpt = get_the_content('');
                    }
                    if ($nb_excerpt == '') {
                        echo wp_html_excerpt(strip_shortcodes($excerpt), 145, '...');
                    } else {
开发者ID:justinwool,项目名称:vortago,代码行数:67,代码来源:nb-sm.php

示例11: widget

    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $show_number = $instance['show_number'];
        $show_img = $instance['show_img'] == "yes" ? true : false;
        ?>
		
		<div class="widget-grey-bg">
		
			<?php 
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>
				
				<div class="recent-posts-widget">
					<ul class="clearfix">
					<?php 
        $the_query = new WP_Query("showposts={$show_number}");
        while ($the_query->have_posts()) {
            $the_query->the_post();
            ?>
						
						<li class="clearfix">
						
							<?php 
            if (function_exists('has_post_thumbnail') && has_post_thumbnail() && $show_img) {
                ?>
								<div class="post-thumb">
									<a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                the_title();
                ?>
"><?php 
                resize_img("width=55&height=55");
                ?>
</a>
								</div>
							<?php 
            }
            ?>
								<div class="detail">
									<h3 class="entry-title"><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h3>
									<span class="entry-meta"><?php 
            the_time(get_option('date_format'));
            ?>
 // <a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number(__('No Comments', 'theme_textdomain'), __('1 Comment', 'theme_textdomain'), __('% Comments', 'theme_textdomain'));
            ?>
</a></span>
								</div>
							
						</li>				
					<?php 
        }
        ?>
					</ul>
				</div>
	
		<?php 
        echo $after_widget;
        ?>
			
		
	</div>	
		
	<?php 
    }
开发者ID:Hevix,项目名称:hevix,代码行数:81,代码来源:widget-recent.php

示例12: arras_widgets_post_loop

function arras_widgets_post_loop($id, $args = array())
{
    global $wp_query, $post;
    $_defaults = array('taxonomy' => 'category', 'show_thumbs' => true, 'show_excerpt' => true, 'query' => array('post_type' => 'post', 'posts_per_page' => 5, 'orderby' => 'date', 'order' => 'DESC'));
    $args['query'] = wp_parse_args($args['query'], $_defaults['query']);
    $args = wp_parse_args($args, $_defaults);
    $q = new WP_Query(arras_prep_query($args));
    if ($q->have_posts()) {
        echo '<ul class="' . $id . '">';
        while ($q->have_posts()) {
            $q->the_post();
            // hack for plugin authors who love to use $post = $wp_query->post
            $wp_query->post = $q->post;
            setup_postdata($post);
            ?>
 <li class="clearfix"> <?php 
            if ($args['show_thumbs']) {
                echo '<a rel="bookmark" href="' . get_permalink() . '" class="thumb">' . arras_get_thumbnail('sidebar-thumb', get_the_ID()) . '</a>';
            }
            ?>
			<a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a><br />
			<span class="sub"><?php 
            printf(__('Posted %s', 'arras'), arras_posted_on(false));
            ?>
 | 
			<a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number(__('No Comments', 'arras'), __('1 Comment', 'arras'), __('% Comments', 'arras'));
            ?>
</a>
			</span>
			
			<?php 
            if ($args['show_excerpt']) {
                ?>
			<p class="excerpt">
			<?php 
                echo get_the_excerpt();
                ?>
			</p>
			<a class="sidebar-read-more" href="<?php 
                the_permalink();
                ?>
"><?php 
                _e('Read More', 'arras');
                ?>
</a>
			<?php 
            }
            ?>
			
			</li>
			<?php 
        }
        echo '</ul>';
    } else {
        echo '<span class="textCenter sub">' . __('No posts at the moment. Check back again later!', 'arras') . '</span>';
    }
    wp_reset_query();
}
开发者ID:Translator5,项目名称:arras-theme,代码行数:68,代码来源:widgets.php

示例13: engine_slider_sc

function engine_slider_sc($atts)
{
    // Variables
    extract(shortcode_atts(array('title' => 'Slider', 'qty' => '4', 'category' => '', 'autoplay' => '5000', 'random' => false, 'thumb_size' => 'large', 'excerpt_length' => '30'), $atts));
    // Defaults
    if (!isset($category)) {
        $category = '';
    }
    if (!isset($random)) {
        $random = '0';
    }
    if (!isset($autoplay)) {
        $autoplay = '0';
    }
    if (!isset($qty)) {
        $qty = '-1';
    }
    if (!isset($thumb_size)) {
        $thumb_size = 'large';
    }
    if (!isset($excerpt_length)) {
        $excerpt_length = '30';
    }
    if (!empty($category)) {
        // Make category an array
        $category = explode(', ', $category);
        $args['category__in'] = $category;
    }
    // Args for the query
    $args = array('posts_per_page' => $qty, 'category__in' => $category);
    $q = new WP_Query($args);
    if ($q->have_posts()) {
        // This is needed for a bunch of HTML
        ob_start();
        ?>
	
	<?php 
        if ($title) {
            ?>
	<h4 class="widget-title"><?php 
            echo stripslashes($title);
            ?>
</h4>
	<?php 
        }
        ?>
	
	<div class="slider flexslider" data-autoplay="<?php 
        echo $autoplay;
        ?>
" data-random="<?php 
        echo $random;
        ?>
">
	
		<ul class="slides">
			
			<?php 
        while ($q->have_posts()) {
            $q->the_post();
            ?>
			<li <?php 
            post_class();
            ?>
>
	
				<article class="the-post">
				
					<div class="featured-image">
						
						<a href="<?php 
            the_permalink();
            ?>
"><?php 
            engine_thumbnail($thumb_size);
            ?>
</a>
						
					</div>
					<!-- /.featured-image -->
							
					<!-- .entry-header -->
					<header class="entry-header">
						
						<div class="entry-meta">
							<span class="entry-comments"><a href="<?php 
            comments_link();
            ?>
"><i class="icon-comments"></i><?php 
            comments_number(0, 1, '%');
            ?>
</a></span>
							<span class="entry-category"><i class="icon-folder-open"></i><?php 
            the_category(', ');
            ?>
</span>
							<span class="entry-date"><i class="icon-calendar"></i><?php 
            the_time(get_option('date_format'));
            ?>
</span>				
//.........这里部分代码省略.........
开发者ID:wangshijun101,项目名称:morketing.cn,代码行数:101,代码来源:shortcode-slider.php

示例14: gazeta_post_meta

    function gazeta_post_meta($content)
    {
        global $post;
        if (!isset($post->ID) || get_post_type($post) != 'post' && !is_single() && is_main_query()) {
            return $content;
        }
        ob_start();
        ?>
			<div class="ns-meta entry-meta">
				<div class="nsm-inner">
					<span><i class="fa fa-clock-o"></i> <a href="<?php 
        print gazeta_get_post_archive_link($post->ID);
        ?>
"><?php 
        print get_the_date();
        ?>
</a></span>
					<?php 
        if (get_comments_number()) {
            ?>
						<span><a href="<?php 
            comments_link();
            ?>
"><i class="fa fa-comments"></i> <?php 
            print get_comments_number();
            ?>
</a></span>
					<?php 
            if (gazeta_get_post_views($post->ID) > 0) {
                ?>
						<span><i class="fa fa-eye"></i> <?php 
                print gazeta_get_post_views($post->ID);
                ?>
</span>
					<?php 
            }
            ?>
					<?php 
        }
        ?>
					<?php 
        do_action('gazeta_post_meta/meta');
        ?>
				</div>
			</div>
		<?php 
        return $content . ob_get_clean();
    }
开发者ID:alvarpoon,项目名称:get-it-write,代码行数:48,代码来源:templates.php

示例15: comments_popup_link

 function comments_popup_link($zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $CSSclass = '', $none = 'Comments Off', $echo = true)
 {
     if (get_xoops_option(wp_mod(), 'wp_use_xoops_comments') == 0) {
         if (empty($GLOBALS['comment_count_cache'][wp_id()]["{$GLOBALS['wp_post_id']}"])) {
             $criteria =& new CriteriaCompo(new Criteria('comment_post_ID', $GLOBALS['wp_post_id']));
             $criteria->add(new Criteria('comment_approved', '1 '));
             // Trick for numeric chars only string compare
             $commentHandler =& wp_handler('Comment');
             $number = $commentHandler->getCount($criteria);
         } else {
             $number = $GLOBALS['comment_count_cache'][wp_id()]["{$GLOBALS['wp_post_id']}"];
         }
     } else {
         $criteria =& new CriteriaCompo(new Criteria('comment_post_ID', $GLOBALS['wp_post_id']));
         $criteria->add(new Criteria('comment_approved', '1 '));
         // Trick for numeric chars only string compare
         $criteria_c =& new CriteriaCompo(new Criteria('comment_content', "<trackback />%", 'like'));
         $criteria_c->add(new Criteria('comment_content', "<pingback />%", 'like'), 'OR');
         $criteria_c->add(new Criteria('comment_type', 'trackback'), 'OR');
         $criteria_c->add(new Criteria('comment_type', 'pingback'), 'OR');
         $criteria->add($criteria_c);
         $commentHandler =& wp_handler('Comment');
         $number = $commentHandler->getCount($criteria);
     }
     $comments_popup_link = "";
     if (0 == $number && 'closed' == $GLOBALS['post']->comment_status && 'closed' == $GLOBALS['post']->ping_status) {
         return _echo($none, $echo);
     } else {
         if (!empty($GLOBALS['post']->post_password)) {
             // if there's a password
             if ($_COOKIE['wp-postpass_' . $GLOBALS['cookiehash']] != $GLOBALS['post']->post_password) {
                 // and it doesn't match the cookie
                 return _echo("Enter your password to view comments", $echo);
             }
         }
         $comments_popup_link .= '<a href="';
         if (!empty($GLOBALS['wpcommentsjavascript'])) {
             $comments_popup_link .= wp_siteurl() . '/' . $GLOBALS['wpcommentspopupfile'] . '?p=' . $GLOBALS['wp_post_id'] . '&amp;c=1';
             $comments_popup_link .= '" onclick="wpopen(this.href); return false"';
         } else {
             // if comments_popup_script() is not in the template, display simple comment link
             $comments_popup_link .= comments_link('', false);
             $comments_popup_link .= '"';
         }
         $comments_popup_link .= ' title="Comment for \'\'' . apply_filters('the_title', $GLOBALS['post']->post_title) . '\'\'"';
         if (!empty($CSSclass)) {
             $comments_popup_link .= ' class="' . $CSSclass . '"';
         }
         $comments_popup_link .= '>';
         $comments_popup_link .= comments_number($zero, $one, $more, $number, false);
         $comments_popup_link .= '</a>';
         return _echo($comments_popup_link, $echo);
     }
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:54,代码来源:template-functions-comment.php


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