コード例 #1
1
ファイル: template-tags.php プロジェクト: themebright/Restful
/**
 * 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 
}
コード例 #2
0
function tpp_posts_widget()
{
    $tpp_posts_query = new WP_Query();
    $tpp_posts_query->query('&posts_per_page=10&orderby=comment_count&order=DESC');
    ?>
	<h3>Posts on this page:</h3>
	<?php 
    if ($tpp_posts_query->have_posts()) {
        while ($tpp_posts_query->have_posts()) {
            $tpp_posts_query->the_post();
            ?>
	<a href="<?php 
            echo the_permalink();
            ?>
"
		title="<?php 
            echo the_title();
            ?>
"><?php 
            echo the_title();
            ?>
</a>
		(<?php 
            echo comments_number();
            ?>
) <br />
	<?php 
        }
    }
    ?>
	<?php 
}
コード例 #3
0
function tpp_posts_widget()
{
    $tpp_posts_query = new WP_Query(array('posts_per_page' => 10, 'orderby' => 'comment_count', 'order' => 'DESC', 'post__in' => get_option('sticky_posts')));
    ?>
	<h3><?php 
    _e('Posts on this page:');
    ?>
</h3>
	<?php 
    if ($tpp_posts_query->have_posts()) {
        while ($tpp_posts_query->have_posts()) {
            $tpp_posts_query->the_post();
            ?>
	<a href="<?php 
            echo the_permalink();
            ?>
"
		title="<?php 
            echo the_title();
            ?>
"><?php 
            echo the_title();
            ?>
</a>
		(<?php 
            echo comments_number();
            ?>
) <br />
	<?php 
        }
    }
    ?>
	<?php 
}
コード例 #4
0
    function appointment_aside_meta_content()
    {
        $current_options = get_option('appointment_options');
        if ($current_options['meta_section_settings'] == 'on') {
            ?>
	        <!--show date of post-->
			<aside class="blog-post-date-area">
							<div class="date"><?php 
            echo get_the_date('j');
            ?>
 <div class="month-year"><?php 
            echo get_the_date('M');
            ?>
,<?php 
            echo get_the_date('Y');
            ?>
</div></div>
							<div class="comment"><a href="<?php 
            the_permalink();
            ?>
"><i class="fa fa-comments"></i><?php 
            comments_number('', 'o', '%');
            ?>
</a></div>
			</aside>
			<?php 
        }
    }
コード例 #5
0
function kbe_custom_columns($column)
{
    global $post;
    switch ($column) {
        case "title":
            the_title();
            break;
        case "author":
            the_author();
            break;
        case "cat":
            echo get_the_term_list($post->ID, 'kbe_taxonomy', ' ', ', ', '');
            break;
        case "tag":
            echo get_the_term_list($post->ID, 'kbe_tags', ' ', ', ', '');
            break;
        case "comment":
            comments_number(__('No Comments', 'kbe'), __('1 Comment', 'kbe'), __('% Comments', 'kbe'));
            break;
        case "views":
            $views = get_post_meta($post->ID, 'kbe_post_views_count', true);
            if ($views) {
                echo $views . __(' Views', 'kbe');
            } else {
                echo __('No Views', 'kbe');
            }
            break;
        case "date":
            the_date();
            break;
    }
}
コード例 #6
0
function tpp_posts_widget()
{
    $tpp_posts_query = new WP_Query();
    $tpp_posts_query->get_posts();
    ?>
	<h3>Posts on this page:</h3>
	<?php 
    if ($tpp_posts_query->have_posts()) {
        while ($tpp_posts_query->have_posts()) {
            $tpp_posts_query->the_post();
            ?>
	<a href="<?php 
            echo the_permalink();
            ?>
"
		title="<?php 
            echo the_title();
            ?>
"><?php 
            echo the_title();
            ?>
</a>
		(<?php 
            echo comments_number();
            ?>
)
	<?php 
        }
    }
    ?>
	<?php 
}
コード例 #7
0
function tpp_posts_widget()
{
    ?>
	<h3>Posts on this page:</h3>
	<?php 
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            ?>
	<div>
	<a href="<?php 
            echo the_permalink();
            ?>
"
		title="<?php 
            echo the_title();
            ?>
"><?php 
            echo the_title();
            ?>
</a>
		(<?php 
            echo comments_number();
            ?>
)
	</div>
	<?php 
        }
    }
    ?>
	<?php 
}
コード例 #8
0
ファイル: themeta.php プロジェクト: ComEnYns/Web-Projects
function matraman_lite_comments()
{
    global $post;
    echo '<span class="comment"><i class="icon icon-chatbubble"></i>';
    comments_number('No Comment', '1 Comment', '% Comments');
    echo '</span>';
}
コード例 #9
0
    function appointment_aside_meta_content()
    {
        $appointment_options = theme_setup_data();
        $news_setting = wp_parse_args(get_option('appointment_options', array()), $appointment_options);
        if ($news_setting['home_meta_section_settings'] == '') {
            ?>
	    <!--show date of post-->
		<aside class="blog-post-date-area">
			<div class="date"><?php 
            echo get_the_date('j');
            ?>
 <div class="month-year"><?php 
            echo get_the_date('M');
            ?>
,<?php 
            echo get_the_date('Y');
            ?>
</div></div>
			<div class="comment"><a href="<?php 
            the_permalink();
            ?>
"><i class="fa fa-comments"></i><?php 
            comments_number('0', '1', '%');
            ?>
</a></div>
		</aside>
		<?php 
        }
    }
コード例 #10
0
 /**
  * Display of Custom Post Type Columns
  * @param array $column
  * @since  1.0.0
  */
 public function custom_columns($column)
 {
     global $post;
     switch ($column) {
         case 'title':
             the_title();
             break;
         case 'author':
             the_author();
             break;
         case 'cat':
             echo get_the_term_list($post->ID, 'docu_cat', ' ', ', ', '');
             break;
         case 'tag':
             echo get_the_term_list($post->ID, 'docu_tag', ' ', ', ', '');
             break;
         case 'comment':
             comments_number(__('No Comments', 'documentate'), __('1 Comment', 'documentate'), __('% Comments', 'documentate'));
             break;
         case 'views':
             $views = get_post_meta($post->ID, 'documentate_post_views_count', true);
             if ($views) {
                 printf(_n('%s view', '%s views', $rating, 'documentate'), $views);
             } else {
                 echo __('No Views', 'documentate');
             }
             break;
         case 'date':
             the_date();
             break;
     }
 }
コード例 #11
0
    function widget($args, $instance)
    {
        extract($args);
        @($title = $instance['title'] ? $instance['title'] : '最热文章');
        @($num = $instance['num'] ? $instance['num'] : 5);
        echo $before_widget;
        ?>
      <div class="panel panel-zan hidden-xs">
        <div class="panel-heading"><?php 
        echo $title;
        ?>
</div>
        <div class="panel-body">
          <ul class="list-group">
            <?php 
        // 设置全局变量,实现post整体赋值
        global $post;
        $posts = zan_get_hotest_posts($num);
        foreach ($posts as $post) {
            setup_postdata($post);
            ?>
              <li class="zan-list clearfix">
                <figure class="thumbnail zan-thumb">
                  <?php 
            the_post_thumbnail(array(75, 75));
            ?>
                </figure>
                <a href="<?php 
            the_permalink();
            ?>
">
                 <h5><?php 
            the_title();
            ?>
</h5>
                </a>
                <div class="sidebar-info">
                  <span><i class="fa fa-calendar"></i> <?php 
            the_time('m月j日, Y');
            ?>
</span>
                  <span><i class="fa fa-comment"></i> <a href="<?php 
            the_permalink();
            ?>
#comments"><?php 
            comments_number('0', '1', '%');
            ?>
</a></span>
                </div>
              </li>
            <?php 
        }
        wp_reset_postdata();
        ?>
          </ul>
        </div>
      </div>
    <?php 
        echo $after_widget;
    }
コード例 #12
0
/**
 * Display common postmeta information. The parent theme originally showed
 * date, author, and a comment link.
 */
function webonary_zeedisplay_display_entry_header()
{
    $options = get_option('themezee_options');
    if (isset($options['themeZee_blog_mode']) and $options['themeZee_blog_mode'] == BLOG_MODE) {
        ?>
		<div class="postmeta">
			<span class="date"><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_time(get_option('date_format'));
        ?>
</a></span>
			<span class="author"><?php 
        the_author();
        ?>
 </span>
			<span class="comment"><a href="<?php 
        the_permalink();
        ?>
#comments"><?php 
        comments_number(__('No comments', ZEE_LANG), __('One comment', ZEE_LANG), __('% comments', ZEE_LANG));
        ?>
</a></span>
		</div>
		<?php 
    }
}
コード例 #13
0
    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 
    }
コード例 #14
0
    /**
     * Front-end display of widget
     **/
    public function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', isset($instance['title']) ? esc_attr($instance['title']) : '');
        $items_num = isset($instance['items_num']) ? esc_attr($instance['items_num']) : '';
        /** 
         * Posts by comment count
         **/
        global $post;
        $ti_most_commented = new WP_Query(array('post_type' => 'post', 'order' => 'DECS', 'orderby' => 'comment_count', 'posts_per_page' => $items_num));
        if ($ti_most_commented->have_posts()) {
            echo $before_widget;
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            ?>
            
            <ul>
			<?php 
            $com = 1;
            ?>
            <?php 
            while ($ti_most_commented->have_posts()) {
                $ti_most_commented->the_post();
                ?>
                <li class="clearfix score-<?php 
                echo $com++;
                ?>
">
                	<span>
                    	<i><?php 
                comments_number('0', '1', '%');
                ?>
</i>
                    </span>
                    <a href="<?php 
                the_permalink();
                ?>
">
                    	<?php 
                if (strlen($post->post_title) > 30) {
                    echo substr(the_title($before = '', $after = '', FALSE), 0, 30) . '...';
                } else {
                    the_title();
                }
                ?>
                    </a>
                </li>
            <?php 
            }
            $com++;
            ?>
            </ul>

		    <?php 
            echo $after_widget;
            wp_reset_postdata();
        }
    }
コード例 #15
0
        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;
        }
コード例 #16
0
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', empty($instance['title']) ? 'Popular This Week' : $instance['title']);
        $postsNum = empty($instance['postsNum']) ? '' : (int) $instance['postsNum'];
        $show_thisweek = isset($instance['thisweek']) ? (bool) $instance['thisweek'] : false;
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        $additional_query = $show_thisweek ? '&year=' . date('Y') . '&w=' . date('W') : '';
        query_posts('post_type=post&posts_per_page=' . $postsNum . '&orderby=comment_count&order=DESC' . $additional_query);
        ?>
	<?php 
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                ?>
		<div class="blog-entry">
			<a href="<?php 
                the_permalink();
                ?>
" class="comments"><?php 
                comments_number('0', '1', '%');
                ?>
</a>
			<h4 class="title"><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h4>
			<p class="meta-info"><?php 
                esc_html_e('Posted', 'Aggregate');
                ?>
 <?php 
                esc_html_e('by', 'Aggregate');
                ?>
 <?php 
                the_author_posts_link();
                ?>
 <?php 
                esc_html_e('on', 'Aggregate');
                ?>
 <?php 
                the_time('n-j-y');
                ?>
</p>
		</div>
	<?php 
            }
        }
        wp_reset_query();
        ?>

<?php 
        echo $after_widget;
    }
コード例 #17
0
 function thb_comments_number($numeric = false)
 {
     global $post;
     if ($numeric) {
         comments_number('0', '1', '%');
     } else {
         comments_number(__('No comments', 'thb_text_domain'), __('1 comment', 'thb_text_domain'), '% ' . __('comments', 'thb_text_domain'));
     }
 }
コード例 #18
0
ファイル: nm-home-tabs.php プロジェクト: popovdenis/kmst
function nm_home_tabs($cats, $width = 463, $height = 210)
{
    $cats = explode(',', $cats);
    $cat = get_category_by_slug($cats[0]);
    $cat = get_category($cat->category_parent);
    echo '<div id="tab-instance-' . $cat->slug . '" class="tabs" style="width: ' . $width . 'px;"><ul class="tabs-nav">';
    $class = ' class="tabs-nav-active"';
    //Generate the nav from the cats
    foreach ($cats as $cat) {
        $cat = get_category_by_slug($cat);
        echo '<li><a id="a-' . $cat->slug . '"' . $class . ' href="javascript:show_home_tab(\'a-' . $cat->slug . '\')">' . $cat->name . '</a></li>';
        $class = '';
    }
    echo '</ul><div class="tabs-content" style="height: ' . $height . 'px;">';
    foreach ($cats as $cat) {
        echo '<ul id="ul-' . $cat . '" class="tabs-content-ul">';
        //Check if is older then 3 days, if is then order by rand
        $orderby = '';
        query_posts('showposts=1&category_name=' . $cat);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                $older = date('YMD');
                $days_since = floor((date('U') - get_the_time('U')) / 86400);
                if ($days_since >= 4) {
                    $orderby = '&orderby=rand';
                }
            }
        }
        query_posts('showposts=5&category_name=' . $cat . $orderby);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                global $post;
                echo '<li class="tabs-content-item">
					<h4><a href="' . get_permalink() . '">' . $post->post_title . '</a></h4>' . '<a href="' . get_permalink() . '">' . article_image($post->ID, 'small', true) . '</a>';
                echo '<p>';
                wswwpx_content_extract('', '15', '15', 2, '', '', TRUE, FALSE);
                echo '</p>';
                echo '<p class="tabs-content-meta">';
                echo '<a href="' . get_permalink() . '">';
                comments_number('No Comments', '1 Comment', '% Comments');
                echo '</a> | Posted: ';
                the_time('l, F jS, Y');
                echo ' | By: <a href="' . getProfileLink($post->post_author) . '">';
                the_author();
                echo '</a>';
                echo '</p>';
                echo '</li>';
            }
        }
        echo '</ul>';
    }
    echo '</div>
		</div>';
}
コード例 #19
0
/**
 * Set up post entry meta.    
 * Meta information for current post: categories, tags, permalink, author, and date.    
 * */
function niche_entry_meta()
{
    $niche_categories_list = get_the_category_list(', ', '');
    $niche_tag_list = get_the_tag_list('', ', ');
    $niche_author = ucfirst(get_the_author());
    $niche_author_url = esc_url(get_author_posts_url(get_the_author_meta('ID')));
    $niche_comments = wp_count_comments(get_the_ID());
    $niche_date = sprintf('<time datetime="%1$s">%2$s</time>', esc_attr(get_the_date('c')), esc_html(get_the_date('F d , Y')));
    ?>
	
	<ul>
       <li><?php 
    printf(__('%s', 'niche'), $niche_date);
    ?>
</li>
       <li><?php 
    _e('By : ', 'niche');
    ?>
<a href="<?php 
    echo $niche_author_url;
    ?>
" rel="tag"><?php 
    echo $niche_author;
    ?>
</a></li>
<?php 
    if (!is_page_template('page-template/front-page.php')) {
        ?>
       <li><?php 
        if (!empty($niche_categories_list)) {
            _e('Category : ', 'niche');
            echo $niche_categories_list;
            ?>
</li><?php 
        }
        ?>
    <?php 
        if (!empty($niche_tag_list)) {
            ?>
		<li><?php 
            _e('Tags : ', 'niche');
            echo $niche_tag_list;
            ?>
</li><?php 
        }
    }
    ?>
       <li><?php 
    $niche_comment = comments_number(__('Comment : 0', 'niche'), __('Comment : 1', 'niche'), __('Comments : %', 'niche'));
    ?>
</li>
    </ul>	
<?php 
}
コード例 #20
0
function theme_comments_render_list($callback)
{
    ?>
	<?php 
    if (have_comments()) {
        ?>
		<div class="cl">&nbsp;</div>
		<h3><?php 
        comments_number('Keine Antworten', 'Eine Antwort', '% Antworten');
        ?>
</h3>
		<ol class="all-comments">
			<?php 
        wp_list_comments('callback=' . $callback);
        ?>
		</ol>

		<?php 
        if (get_comment_pages_count() > 1 && get_option('page_comments')) {
            // Are there comments to navigate through?
            ?>
			<div class="navigation">
				<div class="alignleft"><?php 
            previous_comments_link();
            ?>
</div>
				<div class="alignright"><?php 
            next_comments_link();
            ?>
</div>
			</div>
		<?php 
        }
        ?>
	<?php 
    } else {
        ?>
		<?php 
        if (comments_open()) {
            ?>
	        <!-- If comments are open, but there are no comments. -->
		 <?php 
        } else {
            // comments are closed
            ?>
			<p class="nocomments">Kommentare sind geschlossen.</p>
		<?php 
        }
        ?>
	<?php 
    }
    ?>
	<?php 
}
コード例 #21
0
/**
 * Set up post entry meta.    
 * Meta information for current post: categories, tags, permalink, author, and date.    
 * */
function advent_entry_meta()
{
    $advent_categories_list = get_the_category_list(',', '');
    $advent_tag_list = get_the_tag_list('', ',');
    $advent_author = ucfirst(get_the_author());
    $advent_author_url = esc_url(get_author_posts_url(get_the_author_meta('ID')));
    $advent_comments = wp_count_comments(get_the_ID());
    $advent_date = sprintf('<time datetime="%1$s">%2$s</time>', esc_attr(get_the_date('c')), esc_html(get_the_date('M d, Y')));
    ?>
	
	
               <li><a href="<?php 
    echo $advent_author_url;
    ?>
" rel="tag"><?php 
    echo $advent_author;
    ?>
</a></li>
                
                <li><?php 
    echo $advent_date;
    ?>
</li>
                
                <?php 
    if (!empty($advent_categories_list)) {
        ?>
<li><?php 
        _e('Post in : ', 'advent');
        echo $advent_categories_list;
        ?>
</li><?php 
    }
    ?>
                
                <?php 
    if (!empty($advent_tag_list)) {
        ?>
<li><?php 
        _e('Tags : ', 'advent');
        echo $advent_tag_list;
        ?>
</li><?php 
    }
    ?>
                
                <li><?php 
    $advent_comment = comments_number(__('No Comments', 'advent'), __('1 Comment', 'advent'), __('% Comments', 'advent'));
    ?>
</li>
		
<?php 
}
コード例 #22
0
ファイル: foundation.php プロジェクト: Bobyo/hero
        /** CONSTRUCTOR
         * You'll have to use this if you plan to get to the top of the comments list, as
         * start_lvl() only goes as high as 1 deep nested comments */
        function __construct()
        {
            ?>

        <h3 class="nr-of-comments"><?php 
            comments_number(__('No comments', 'foundationpress'), __('1 Comment', 'foundationpress'), __('% Comments', 'foundationpress'));
            ?>
</h3>
        <ul class="comment-list">

    <?php 
        }
コード例 #23
0
 /**
  * Print HTML with meta information for the current post-date/time and author.
  *
  * @since 2.2.0
  */
 function odin_posted_on()
 {
     if (is_sticky() && is_home() && !is_paged()) {
         echo '<span class="featured-post">' . __('Sticky', 'morfeu') . ' </span>';
     }
     // Set up and print post meta information.
     printf('<span class="entry-date"> <i class="icon-circle glyphicon glyphicon-calendar"></i> <time class="entry-date" datetime="%s">%s</time></span> <i class="icon-circle glyphicon glyphicon-user"></i> <span class="author vcard">' . __('By', 'morfeu') . ' <a class="url fn n" href="%s" rel="author">%s</a></span>', esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author());
     printf(' <i class="icon-circle glyphicon glyphicon-comment"></i>');
     comments_number(__('0 Comments', 'morfeu'), __('1 Comment', 'morfeu'), __('% Comments', 'morfeu'));
     printf(' <i class="icon-circle glyphicon glyphicon-folder-open"></i>');
     the_category(', ');
 }
コード例 #24
0
ファイル: utility.php プロジェクト: alextkd/fdsmc
/** Contango Post Comments */
function contango_post_comments()
{
    if (!comments_open() || post_password_required()) {
        return;
    }
    ob_start();
    comments_number(__('Leave a Comment', 'contango'), __('1 Comment', 'contango'), __('% Comments', 'contango'));
    $comments = ob_get_clean();
    /** Output */
    $comments = sprintf('<a href="%s">%s</a>', esc_url(get_comments_link()), $comments);
    $output = sprintf('%2$s<span class="comments-link">%1$s</span>', $comments, contango_entry_meta_sep());
    return $output;
}
コード例 #25
0
/** DistinctPress Post Comments */
function distinctpress_post_comments()
{
    if (!comments_open() || post_password_required()) {
        return;
    }
    ob_start();
    comments_number(__('Leave a Comment', 'distinctpress'), __('1 Comment', 'distinctpress'), __('% Comments', 'distinctpress'));
    $comments = ob_get_clean();
    /** Output */
    $comments = sprintf('<a href="%s"><i class="el-icon-comment meta-icon"></i>%s</a>', esc_url(get_comments_link()), $comments);
    $output = sprintf('<span class="entry-meta-sep"> &sdot; </span><span class="comments-link">%1$s</span>', $comments);
    return $output;
}
コード例 #26
0
/**
 * Wp in Progress
 * 
 * @author WPinProgress
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * It is also available at this URL: http://www.gnu.org/licenses/gpl-3.0.txt
 */
function novalite_before_content_function()
{
    global $post;
    ?>


    <div class="line"> 
    
        <div class="entry-info">
       
            <div class="entry-date"><strong> <?php 
    _e('Posted on:', 'wip');
    ?>
 </strong> <?php 
    echo get_the_date();
    ?>
 <span class="sep">/</span> </div>
            
            <?php 
    if (comments_open() && novalite_setting('wip_view_comments') == "on") {
        ?>

                <div class="entry-comments"> <strong><?php 
        _e('Comments: ', 'wip');
        ?>
</strong>
                    <?php 
        echo comments_number('<a href="' . get_permalink($post->ID) . '#respond">' . __("No comments", "wip") . '</a>', '<a href="' . get_permalink($post->ID) . '#comments">1 ' . __("comment", "wip") . '</a>', '<a href="' . get_permalink($post->ID) . '#comments">% ' . __("comments", "wip") . '</a>');
        ?>

                <span class="sep">/</span> </div> 
            <?php 
    }
    ?>

            
            <div class="entry-standard"> 
            	<strong> <?php 
    _e('Categories: ', 'wip');
    echo the_category(', ');
    ?>
 </strong>
            </div>

        </div>

    </div>
    
<?php 
}
コード例 #27
0
function gardenia_entry_meta()
{
    $gardenia_categories_list = get_the_category_list(',', '');
    $gardenia_tag_list = get_the_tag_list('', ',');
    $gardenia_author = get_the_author();
    $gardenia_author_url = esc_url(get_author_posts_url(get_the_author_meta('ID')));
    $gardenia_comments = wp_count_comments(get_the_ID());
    $gardenia_date = sprintf('<time datetime="%1$s">%2$s</time>', sanitize_text_field(get_the_date('c')), esc_html(get_the_date()));
    ?>
	
		<div class="fancy_categories">
                <div class="glyphicon glyphicon-user color"><a href="<?php 
    echo $gardenia_author_url;
    ?>
" rel="tag"><?php 
    echo $gardenia_author;
    ?>
</a></div>
                <div class="glyphicon glyphicon-calendar color"><a href="<?php 
    echo esc_url(get_day_link(get_post_time('Y'), get_post_time('m'), get_post_time('j')));
    ?>
" rel="tag"><?php 
    echo $gardenia_date;
    ?>
</a></div>
               <?php 
    if (!empty($gardenia_tag_list)) {
        ?>
<div class="glyphicon glyphicon-tag color"><?php 
        echo $gardenia_tag_list;
        ?>
</div><?php 
    }
    ?>
               <?php 
    if (!empty($gardenia_categories_list)) {
        ?>
<div class="glyphicon glyphicon-folder-open color"><?php 
        echo $gardenia_categories_list;
        ?>
</div><?php 
    }
    ?>
                <div class="glyphicon glyphicon-comment color"><span class="comment"><?php 
    comments_number(__('No Comments', 'gardenia'), __('1 Comment', 'gardenia'), __('% Comments', 'gardenia'));
    ?>
</span></div>
		</div>
<?php 
}
コード例 #28
0
        /** CONSTRUCTOR
         * You'll have to use this if you plan to get to the top of the comments list, as
         * start_lvl() only goes as high as 1 deep nested comments */
        function __construct()
        {
            ?>

        <h3><?php 
            comments_number(__('No Responses to', 'foundationpress'), __('One Response to', 'foundationpress'), __('% Responses to', 'foundationpress'));
            ?>
 &#8220;<?php 
            the_title();
            ?>
&#8221;</h3>
        <ol class="comment-list">

    <?php 
        }
コード例 #29
0
function hjemmesider_intralist($atts)
{
    global $post;
    ob_start();
    // define query parameters based on attributes
    $options = array('post_type' => 'simpleintra', 'order' => 'DESC');
    $query = new WP_Query($options);
    // run the loop based on the query
    if ($query->have_posts()) {
        ?>

<ul class="intranet-liste nul">
<?php 
        while ($query->have_posts()) {
            $query->the_post();
            ?>
<li>
<h4><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h4>
<p class="dato"><b>Udgivet:</b> <?php 
            the_date();
            ?>
</p>
<p class="forfatter"><b>Forfatter:</b> <?php 
            the_author();
            ?>
</p>
<p class="comment-count"><b>Kommentarer: </b> <?php 
            comments_number('0', '1', '%');
            ?>
</p>
</li>
<?php 
        }
        wp_reset_postdata();
        ?>
</ul>
    <?php 
        $myvariable = ob_get_clean();
        return $myvariable;
    }
}
コード例 #30
0
ファイル: lib.php プロジェクト: mnjit/aa-global
function dt_get_comments_link($wrap = '', $opts = array(), $post_id = null)
{
    global $post;
    $custom_id = true;
    $comments_number = 0;
    if (empty($post_id)) {
        $post_id = $post->ID;
        $custom_id = false;
    }
    if (empty($wrap)) {
        $wrap = '<a href="%HREF%" class="comments_count">%COUNT%</a>';
    }
    $defaults = array('text' => array(_x('no comments', 'comments link', LANGUAGE_ZONE), _x('1 comment', 'comments link', LANGUAGE_ZONE), _x('% comments', 'comments link', LANGUAGE_ZONE)), 'no_coments' => _x('Comments closed for this post', 'comments link', LANGUAGE_ZONE));
    $opts = wp_parse_args($opts, $defaults);
    if (!comments_open($post_id)) {
        echo $opts['no_coments'];
        return false;
    }
    $comments_number = get_comments_number($post_id);
    $link_target = 'comment-form';
    if ($comments_number) {
        $link_target = 'comments';
    }
    $wrap = str_replace('%HREF%', get_permalink($post_id) . '#' . $link_target, $wrap);
    $str = explode('%COUNT%', $wrap);
    if (isset($str[0])) {
        echo $str[0];
    }
    if (!$custom_id) {
        comments_number($opts['text'][0], $opts['text'][1], $opts['text'][2]);
    } else {
        if (!$comments_number) {
            echo $opts['text'][0];
        } elseif (1 == $comments_number) {
            echo $opts['text'][1];
        } else {
            echo str_replace('%', $comments_number, $opts['text'][2]);
        }
    }
    if (isset($str[1])) {
        echo $str[1];
    }
    return true;
}