Example #1
0
 /**
  * loop
  * @global type $post
  * @return type
  * @since 1.272
  */
 function raindrops_post_author()
 {
     global $post;
     $author = raindrops_blank_fallback(get_the_author(), 'Somebody');
     $author_attr_title_string = sprintf(esc_attr__('View all posts by %s', 'raindrops'), wp_kses($author, array()));
     $author_html = '<span class="author vcard"><a class="url fn nickname" href="%1$s" title="%2$s">%3$s</a></span> ';
     if ("avatar" == raindrops_warehouse_clone('raindrops_display_article_author')) {
         $author = get_avatar(get_the_author_meta('ID'), 24) . '<span class="screen-reader-text">' . $author . '</span>';
     }
     $author_html = sprintf($author_html, get_author_posts_url(get_the_author_meta('ID')), $author_attr_title_string, $author);
     $author_html = apply_filters('raindrops_post_author', $author_html);
     return $author_html;
 }
Example #2
0
 function raindrops_display_recent_post_group_by_category($limit_posts = 5, $args = array())
 {
     global $raindrops_group_by_category_icon;
     $raindrops_get_post_array_group_by_category = raindrops_get_post_array_group_by_category($limit_posts, $args);
     $raindrops_date_format = get_option('date_format') . ' ' . get_option('time_format');
     $result = apply_filters('raindrops_display_recent_post_group_by_category_before', '');
     $wrap_html = '<ul class="xoxo">%1$s</ul>';
     $category_title = '<li class="post-group-by-category-title"><h3 class="post-group_by-category-title category-title %3$s"><a href="%1$s">%2$s</a></h3><ul>';
     $entry_item = '<li><a href="%1$s">%3$s</a><p><span title="%4$s">%2$s</span> </p>';
     $entry_item = '<li>' . '<a href="%1$s" class="post-group_by-category-entry-title %8$s">%3$s</a>' . '<%4$s class="entry-date updated post-group-by-category-time" %5$s>%2$s</%4$s>' . '<span class="author vcard">' . ' <a class="url fn n post-group_by-category-author" href="%6$s">%7$s</a>' . '</span></li>';
     $loop_end_html = '</ul></li>';
     $raindrops_group_by_category_icon = apply_filters('raindrops_group_by_category_icon', true);
     foreach ($raindrops_get_post_array_group_by_category as $key => $vals) {
         $cat_id = get_cat_ID($key);
         $cat_property = get_category($cat_id);
         $cat_slug = sanitize_html_class($cat_property->slug);
         $cat_slug = apply_filters('raindrops_post_group_by_category_title_class', $cat_slug, $key);
         if (!empty($vals)) {
             $result .= sprintf($category_title, get_category_link($cat_id), $key, $cat_slug);
         }
         foreach ($vals as $val) {
             $permalink = esc_url(get_permalink($val));
             $date = get_the_time($raindrops_date_format, $val);
             $thumbnail = '';
             if (has_post_thumbnail($val) && !post_password_required() && true == $raindrops_group_by_category_icon) {
                 $thumbnail .= "\n" . str_repeat("\t", 11) . '<span class="h2-thumb">';
                 $thumbnail .= get_the_post_thumbnail($val, array(48, 48), array("style" => "vertical-align:middle;", "alt" => esc_attr__('Featured Image', 'raindrops')));
                 $thumbnail .= "\n" . str_repeat("\t", 11) . '</span>';
             }
             if (!has_post_thumbnail($val) && !is_singular() && !post_password_required() && true == $raindrops_group_by_category_icon) {
                 $thumbnail = apply_filters('raindrops_title_thumbnail', $thumbnail, '<span class="h2-thumb">', '</span>');
             }
             $entry_title_text = sprintf('<span class="entry-title-text">%1$s</span>', get_the_title($val));
             $title = apply_filters('raindrops_display_recent_post_group_by_category_post_thumb', $thumbnail) . $entry_title_text;
             if (empty($thumbnail)) {
                 $thumbnail_class = 'no-thumb';
             } else {
                 $thumbnail_class = 'has-thumb';
             }
             $time_element = raindrops_doctype_elements('span', 'time', false);
             $attribute_time = raindrops_doctype_elements('', 'datetime="' . esc_attr(get_the_date('c')) . '"', false);
             $author = raindrops_blank_fallback(get_the_author(), 'Somebody');
             $author = wp_kses($author, array());
             $author_link = get_author_posts_url(get_the_author_meta('ID'));
             $author_link = esc_url($author_link);
             $result .= sprintf($entry_item, $permalink, $date, $title, $time_element, $attribute_time, $author_link, $author, $thumbnail_class);
         }
         $result .= $loop_end_html;
     }
     $result = sprintf($wrap_html, $result);
     return apply_filters('raindrops_display_recent_post_group_by_category', $result);
 }