/** * Custom Comment Template * ----------------------------------------------------------------------------- * @param string $comment The comment. * @param array $args Array argument * @param int $depth Depth of the comments thread. */ function kaitain_theme_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; $comment_classes = array('comments__comment', 'vspace--full'); ?> <li <?php comment_class($comment_classes); ?> id="comments__comment--<?php comment_ID(); ?> "> <div class="comments__photo avatar"> <?php kaitain_avatar_background_html($comment, 'tc_post_avatar', 'author-photo'); ?> </div> <div class="comments__body"> <header class="comments__header vspace--quarter"> <h5 class="comments__meta"> <span class="comments__author-website"><?php comment_author_link(); ?> </span> <?php printf('<span class="%s"><time datetime="%s">%s</time></span>', 'post-date', get_comment_date('Y-M-d H:i'), get_comment_date_strftime()); ?> </h5> </header> <div class="comments__comment-body vspace--quarter"> <?php if (!$comment->comment_approved) { printf('<p class="%s">%s</p>', 'comments__unapproved', __('Tá do thrácht á mheas.', 'kaitain')); } else { comment_text(); } ?> </div> <?php if (is_user_logged_in()) { ?> <footer class="comments__footer"> <h5 class="comments_edit-link"> <?php edit_comment_link(__('edit', 'kaitain'), '', ''); ?> </h5> </footer> <?php } ?> </div> </li> <?php }
* @author Mark Grealish <*****@*****.**> * @copyright Copyright (c) 2014-2015, Tuairisc Bheo Teo * @license https://www.gnu.org/copyleft/gpl.html The GNU GPL v3.0 * @version 2.0 * @link https://github.com/bhalash/kaitain-theme * @link http://www.tuairisc.ie */ get_header(); $page_number = intval(get_query_var('paged')); $author = isset($_GET['author_name']) ? get_user_by('slug', $author_name) : get_userdata(intval($author)); ?> <div class="author author__profile"> <div class="avatar"> <?php kaitain_avatar_background_html($author->ID, 'tc_post_avatar', 'author__photo author-photo'); ?> </div> <div class="author__wrap"> <h1 class="author__name"> <span class="author-link"><a class="green-link--hover" href="<?php printf(get_author_posts_url($author->ID)); ?> "><?php printf($author->display_name); ?> </a></span> </div> </div> <hr>
/** * Widget Public Display * ------------------------------------------------------------------------- * @param array $defaults Widget default values. * @param array $instance Widget instance arguments. */ public function widget($defaults, $instance) { $classes = array('container' => 'widget--authors flex--four-col--div', 'anchor' => 'green-link--hover widget--authors__author', 'author' => 'widget--authors__author', 'author_name' => 'widget--authors__name text--bold', 'avatar' => 'author-photo widget--authors__photo vspace--half'); $title = apply_filters('widget_title', $instance['widget_title']); $author_query = get_users(array('include' => $instance['author_list'])); if (!empty($defaults['before_widget'])) { printf('%s', $defaults['before_widget']); } printf($defaults['before_title'] . $title . $defaults['after_title']); // Wrapping interior container. printf('<div class="%s">', $classes['container']); foreach ($author_query as $author) { printf('<div class="%s" id="%s">', $classes['author'], 'widget--authors--' . $author->user_nicename); printf('<a class="%s" title="%s" href="%s">', $classes['anchor'], $author->display_name, get_author_posts_url($author->ID), $author->display_name); // Avatar image. kaitain_avatar_background_html($author->ID, 'tc_home_avatar', $classes['avatar']); printf('<h6 class="%s">%s</h6>', $classes['author_name'], $author->display_name); printf('</a>'); printf('</div>'); } printf('</div>'); if (!empty($defaults['after_widget'])) { printf('%s', $defaults['after_widget']); } printf('<hr>'); wp_reset_postdata(); }