コード例 #1
0
ファイル: front-page.php プロジェクト: jackmachin/bayer
			    			<?php echo get_the_author(); ?>
			    		</div>
		    			<?php }
		    			if ( has_excerpt() || get_the_content() != '' ) { ?>
		    			<div class="entry-text">
	    				<?php
	    			        the_excerpt();
	    				?>
                        <?php

                            if (in_category ('comments')) {

                               echo Decent_Comments_Renderer::get_comments(
                                   $options = array(
                                    'show_avatar'=> true,
                                    'number' => '3',
                                    'max_excerpt_words' => '10',
                                    )
                                  );

                            }

                            if(get_the_tag_list()) {
                                echo get_the_tag_list('<p class="hashtags">#',', #','</p>');
                            }


                        ?>
	    				</div>
	    				<?php } ?>
	    				<?php } ?>
コード例 #2
0
 /**
  * Renders comments based on shortcode attributes.
  * @param array $atts settings
  * @param string $content unused
  * @return rendered comments
  */
 static function decent_comments($atts, $content = null)
 {
     $options = shortcode_atts(Decent_Comments_Renderer::$defaults, $atts);
     return Decent_Comments_Renderer::get_comments($options);
 }
コード例 #3
0
 /**
  * Statics initialization.
  */
 static function init()
 {
     self::$orderby_options = array('comment_author_email' => __('Author Email', TD), 'comment_author_url' => __('Author URL', TD), 'comment_content' => __('Content', TD), 'comment_date_gmt' => __('Date', TD), 'comment_karma' => __('Karma', TD), 'comment_post_ID' => __('Post', TD));
     self::$order_options = array('ASC' => __('Ascending', TD), 'DESC' => __('Descending', TD));
 }
コード例 #4
0
 /**
  * Widget output
  * 
  * @see WP_Widget::widget()
  */
 function widget($args, $instance)
 {
     // Note that there won't be any efficient caching unless a persistent
     // caching mechanism is used. WordPress' default cache is persistent
     // during a request only so this won't have any effect on our widget
     // unless it were printed twice on a page - and that won't happen as
     // each widget is different and cached by its own id.
     // @see http://codex.wordpress.org/Class_Reference/WP_Object_Cache
     $cache = wp_cache_get(self::$cache_id, self::$cache_flag);
     if (!is_array($cache)) {
         $cache = array();
     }
     if (isset($cache[$args['widget_id']])) {
         echo $cache[$args['widget_id']];
         return;
     }
     extract($args);
     $title = apply_filters('widget_title', $instance['title']);
     $widget_id = $args['widget_id'];
     // output
     $output = '';
     $output .= $before_widget;
     if (!empty($title)) {
         $output .= $before_title . $title . $after_title;
     }
     $output .= Decent_Comments_Renderer::get_comments($instance);
     $output .= $after_widget;
     echo $output;
     $cache[$args['widget_id']] = $output;
     wp_cache_set(self::$cache_id, $cache, self::$cache_flag);
 }