function ewf_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; switch ($comment->comment_type) { case '': ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?> "> <div class="comment-body <?php if (!get_option('show_avatars')) { echo 'no-avatar'; } ?> "> <div class="comment-author vcard" > <?php if (get_option('show_avatars')) { echo get_avatar($comment, 80); } ?> <cite class="fn"> <?php $comment_url = get_comment_link(); echo '<a class="url" rel="external nofollow" href="' . $comment_url . '">' . get_comment_author() . '</a>'; ?> </cite> <span class="says"><?php echo __('says', 'bitpub'); ?> :</span> </div> <div class="comment-meta commentmetadata"> <a href="<?php comment_link(); ?> "> <?php comment_date(); echo ' ' . __('at', 'bitpub') . ' '; comment_time(); ?> </a> </div> <?php if ($comment->comment_approved == '0') { ?> <em><?php _e('Your comment is awaiting moderation.', 'bitpub'); ?> </em> <?php } ?> <?php comment_text(); ?> <!-- get_edit_comment_link(); --> <div class="reply"> <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); echo ' '; edit_comment_link(); ?> </div> </div> <?php break; case 'pingback': case 'trackback': ?> <li class="post pingback"> <p><?php _e('Pingback:', 'bitpub'); ?> <?php comment_author_link(); edit_comment_link(__('Edit', 'bitpub'), ' '); ?> </p> <?php break; } }
/** * evolve_pings_callback() recreate the comment list * * @since 0.3 * @needsdoc */ function evolve_pings_callback($comment, $args, $depth) { $GLOBALS['comment'] = $comment; $tag = apply_filters('evolve_pings_callback_tag', (string) 'li'); // Available filter: evolve_pings_callback_tag $time = apply_filters('evolve_pings_callback_time', (string) ' on '); // Available filter: evolve_pings_callback_time $when = apply_filters('evolve_pings_callback_when', (string) ' at '); // Available filter: evolve_pings_callback_time ?> <?php if ($comment->comment_approved == '0') { echo '<p class="ping-unapproved moderation alert">Your trackback is awaiting moderation.</p>\\n'; } ?> <!--BEING .pings--> <<?php echo $tag; ?> class="<?php echo semantic_comments(); ?> " id="ping-<?php echo $comment->comment_ID; ?> "> <?php comment_author_link(); echo $time; ?> <a class="trackback-time" href="<?php comment_link(); ?> "><?php comment_date(); echo $when; comment_time(); ?> </a> <?php }
function custom_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?> "> <div class="the_comment"> <?php if (function_exists('get_avatar')) { echo get_avatar($comment, '50'); } ?> <div class="the_comment_author"><strong><?php comment_author_link(); ?> </strong> <?php _e('says', 'designcrumbs'); ?> </div> <?php if ($comment->comment_approved == '0') { //message if comment is held for moderation ?> <br><em><?php _e('Your comment is awaiting moderation', 'designcrumbs'); ?> .</em><br> <?php } ?> <div class="the_comment_text"><?php comment_text(); ?> </div> <small class="commentmetadata"> <?php comment_date(get_option('date_format')); ?> - <?php comment_date('g:i a'); ?> - <a href="<?php comment_link(); ?> " class="comment_permalink"><?php _e('Permalink', 'designcrumbs'); ?> </a> </small> <div class="reply"> <?php edit_comment_link(__('Edit', 'designcrumbs'), '', ' | '); echo comment_reply_link(array('reply_text' => __('Reply', 'designcrumbs'), 'depth' => $depth, 'max_depth' => $args['max_depth'])); ?> </div> <div class="clear"></div> </div> <?php }
function my_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; switch ($comment->comment_type) { case 'pingback': case 'trackback': ?> <li class="pingback"> <p><b>Pingback</b>: <?php comment_author_link(); ?> </p> <?php break; default: ?> <li<?php // comment_class(); ?> > <article class="comment" id="comment-<?php comment_ID(); ?> "> <header class="comment-head vcard"> <h3 class="fn"> <?php comment_author_link(); ?> </h3> <span class="meta comment-meta"> <time datetime="<?php comment_date('c'); ?> " pubdate><?php comment_date('jS F Y'); ?> @ <?php comment_time('g:iA'); ?> </time> <a href="<?php comment_link(); ?> " title="Comment Permalink">#</a> </span> <?php if ($comment->comment_approved == '0') { ?> <em class="moderation"> Awaiting moderation </em> <?php } ?> </header> <div class="comment-body"> <?php comment_text(); ?> </div> <?php comment_reply_link(array_merge($args, array('reply_text' => __('Reply', 'twentyeleven'), 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </article> <?php break; } }
function hb_format_comment($comment, $args, $depth) { $isByAuthor = false; if ($comment->comment_author_email == get_the_author_meta('email')) { $isByAuthor = true; } //$GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?> "> <div id="div-comment-<?php comment_ID(); ?> " class="comment-body"> <div class="comment-author vcard"> <span class="rounded-element float-left"> <?php echo get_avatar($comment, $size = '76'); ?> </span> <cite class="fn"><?php comment_author_link(); ?> </cite> <div class="reply"> <?php comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'before' => '<span class="sep">·</span> ', 'max_depth' => $args['max_depth'])), get_comment_ID()); ?> </div> <br/> <?php if ($isByAuthor) { ?> <span class="author-tag"><?php _e('Author', 'hbthemes'); ?> </span><?php } ?> </div> <div class="comment-meta commentmetadata"> <a href="<?php comment_link(); ?> "> <time itemprop="commentTime" itemscope="itemscope" datetime="<?php comment_time('c'); ?> "><?php comment_date('F j, Y', get_comment_ID()); _e(' at ', 'hbthemes'); comment_time('g:i A'); ?> </time> </a> </div> <div class="comment-inner"> <?php if ($comment->comment_approved == '0') { ?> <em class="moderation"><?php _e('Your comment is awaiting moderation.', 'hbthemes'); ?> </em> <br /> <?php } ?> <?php comment_text(); ?> </div> </div> <?php }
function camp_comment_callback() { ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?> "> <div class="comment-body" id="div-comment-<?php comment_ID(); ?> "> <div class="comment-author vcard"> <?php echo get_avatar(get_the_author_meta('ID'), 50); ?> <cite class="fn"><?php comment_author_link(); ?> </cite> <span class="says"><?php _e('says:', 'camp'); ?> </span> </div> <!-- .comment-author --> <div class="comment-meta"> <a href="<?php comment_link(); ?> "> <?php echo get_comment_date() . __(' at ', 'camp') . get_comment_time(); ?> </a> </div> <!-- .comment-meta --> <?php comment_text(); ?> <div class="reply"> <?php comment_reply_link(array('add_below' => 'div-comment', 'depth' => 1, 'max_depth' => 10, 'reply_text' => __('Reply', 'camp'))); edit_comment_link(__('Edit', 'camp'), ' | ', ''); ?> </div> </div> </li> <?php }
/** * Callback for displaying a comment * * @todo eventually move to bunyad templates with auto-generated functions as template containers * * @param mixed $comment * @param array $args * @param integer $depth */ function bunyad_smartmag_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; switch ($comment->comment_type) { case 'pingback': case 'trackback': ?> <li class="post pingback"> <p><?php _e('Pingback:', 'bunyad'); ?> <?php comment_author_link(); edit_comment_link(__('Edit', 'bunyad'), '<span class="edit-link">', '</span>'); ?> </p> <?php break; default: ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?> "> <article id="comment-<?php comment_ID(); ?> " class="comment"> <div class="comment-avatar"> <?php echo get_avatar($comment, 40); ?> </div> <div class="comment-meta"> <span class="comment-author"><?php comment_author_link(); ?> </span> <?php _e('on', 'bunyad'); ?> <a href="<?php comment_link(); ?> " class="comment-time" title="<?php comment_date(); _e(' at ', 'bunyad'); comment_time(); ?> "> <time pubdate datetime="<?php comment_time('c'); ?> "><?php comment_date(); ?> <?php comment_time(); ?> </time> </a> <?php edit_comment_link(__('Edit', 'bunyad'), '<span class="edit-link"> · ', '</span>'); ?> </div> <!-- .comment-meta --> <div class="comment-content"> <?php comment_text(); ?> <?php if ($comment->comment_approved == '0') { ?> <em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.', 'bunyad'); ?> </em> <?php } ?> <div class="reply"> <?php comment_reply_link(array_merge($args, array('reply_text' => __('Reply', 'bunyad') . ' <i class="fa fa-angle-right"></i>', 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </div><!-- .reply --> </div> </article><!-- #comment-N --> <?php break; } }
<?php if ( have_comments() ) : while ( have_comments() ) : the_comment(); $comment_post = get_post($comment->comment_post_ID); get_post_custom($comment_post->ID); ?> <item> <title><?php if ( !is_singular() ) { $title = get_the_title($comment_post->ID); $title = apply_filters('the_title_rss', $title); printf(ent2ncr(__('Comment on %1$s by %2$s')), $title, get_comment_author_rss()); } else { printf(ent2ncr(__('By: %s')), get_comment_author_rss()); } ?></title> <link><?php comment_link() ?></link> <dc:creator><?php echo get_comment_author_rss() ?></dc:creator> <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true, false), false); ?></pubDate> <guid isPermaLink="false"><?php comment_guid() ?></guid> <?php if ( post_password_required($comment_post) ) : ?> <description><?php echo ent2ncr(__('Protected Comments: Please enter your password to view comments.')); ?></description> <content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded> <?php else : // post pass ?> <description><?php comment_text_rss() ?></description> <content:encoded><![CDATA[<?php comment_text() ?>]]></content:encoded> <?php endif; // post pass do_action('commentrss2_item', $comment->comment_ID, $comment_post->ID); ?> </item> <?php endwhile; endif; ?> </channel>
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); $limit = $instance['limit'] != 0 ? absint($instance['limit']) : 4; $post_type = $instance['post_type']; $show_date = empty($instance['show_date']) ? 0 : $instance['show_date']; $show_avatar = empty($instance['show_avatar']) ? 0 : $instance['show_avatar']; $show_author = empty($instance['show_author']) ? 0 : $instance['show_author']; $show_comment = empty($instance['show_comment']) ? 0 : $instance['show_comment']; $is_slider = empty($instance['is_slider']) ? 0 : $instance['is_slider']; $row = $instance['row'] != 0 ? absint($instance['row']) : 2; $show_nav = empty($instance['show_nav']) ? 0 : $instance['show_nav']; $auto_play = empty($instance['auto_play']) ? 0 : $instance['auto_play']; echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } $args = array('number' => $limit, 'status' => 'approve', 'post_status' => 'publish', 'comment_type' => ''); if ($post_type != 'all') { $args['post_type'] = $post_type; } $comments = get_comments($args); if ($comments) { $count = 0; $num_posts = count($comments); if ($num_posts <= $row) { $is_slider = false; } if (!$is_slider) { $row = $num_posts; } $extra_class = ''; $extra_class .= $is_slider ? 'ts-slider loading' : ''; $extra_class .= $is_slider && $show_nav ? ' has-navi' : ''; ?> <div class="ts-recent-comments-widget-wrapper <?php echo esc_attr($extra_class); ?> " data-show_nav="<?php echo esc_attr($show_nav); ?> " data-auto_play="<?php echo esc_attr($auto_play); ?> "> <?php foreach ((array) $comments as $comment) { $GLOBALS['comment'] = $comment; ?> <?php if ($count % $row == 0) { ?> <div class="per-slide"> <ul class="comment_list_widget"> <?php } ?> <li> <div class="comment-meta"> <?php if ($show_avatar) { ?> <div class="avatar"> <a href="<?php comment_link(); ?> "><?php echo get_avatar($comment->comment_author_email); ?> </a> </div> <?php } ?> <div class="meta"> <?php if ($show_author) { ?> <span class="author"> <a href="<?php echo get_comment_author_url() == '' ? 'javascript: void(0)' : get_comment_author_url(); ?> " rel="external nofollow"><?php echo esc_html($comment->comment_author); ?> </a> </span> <?php } ?> <?php if ($show_date) { ?> <span class="date"> <?php comment_date('M d, Y'); ?> </span> <?php } ?> </div> </div> <?php if ($show_comment) { ?> <blockquote class="comment-body"><?php echo ts_string_limit_words(wp_strip_all_tags(get_comment_text()), 15); ?> </blockquote> <?php } ?> </li> <?php if ($count % $row == $row - 1 || $count == $num_posts - 1) { ?> </ul> </div> <?php } ?> <?php $count++; } ?> </div> <?php } echo $after_widget; }
function custom_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?> "> <div class="the_comment clearfix"> <?php if (function_exists('get_avatar')) { echo get_avatar($comment, '120'); } ?> <div class="the_comment_author"><?php echo sprintf(__('<span>%1$s</span> says', 'designcrumbs'), get_comment_author_link()); ?> </div> <?php if ($comment->comment_approved == '0') { //message if comment is held for moderation ?> <span class="moderation"><?php _e('Your comment is awaiting moderation', 'designcrumbs'); ?> .</span> <?php } ?> <div class="the_comment_text"><?php comment_text(); ?> </div> <small class="commentmetadata"> <a href="<?php comment_link(); ?> " class="comment_permalink"><i class="fa fa-clock-o"></i><?php comment_date(get_option('date_format')); ?> - <?php comment_date('g:i a'); ?> </a> </small> <div class="reply"> <?php edit_comment_link('<i class="fa fa-pencil"></i>' . __('Edit', 'designcrumbs')); echo comment_reply_link(array('reply_text' => '<i class="fa fa-reply"></i>' . __('Reply', 'designcrumbs'), 'depth' => $depth, 'max_depth' => $args['max_depth'])); ?> </div> </div> <?php }
?></title> <link rel="alternate" href="<?php comment_link(); ?>" type="<?php bloginfo_rss('html_type'); ?>" /> <author> <name><?php comment_author_rss(); ?></name> <?php if (get_comment_author_url()) echo '<uri>' . get_comment_author_url() . '</uri>'; ?> </author> <id><?php comment_link(); ?></id> <updated><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></updated> <published><?php echo mysql2date('Y-m-d\TH:i:s\Z', get_comment_time('Y-m-d H:i:s', true), false); ?></published> <?php if ( post_password_required($comment_post) ) : ?> <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php echo get_the_password_form(); ?>]]></content> <?php else : // post pass ?> <content type="html" xml:base="<?php comment_link(); ?>"><![CDATA[<?php comment_text(); ?>]]></content> <?php endif; // post pass // Return comment threading information (http://www.ietf.org/rfc/rfc4685.txt) if ( $comment->comment_parent == 0 ) : // This comment is top level ?> <thr:in-reply-to ref="<?php the_guid() ?>" href="<?php the_permalink_rss() ?>" type="<?php bloginfo_rss('html_type'); ?>" /> <?php else : // This comment is in reply to another comment $parent_comment = get_comment($comment->comment_parent); // The rel attribute below and the id tag above should be GUIDs, but WP doesn't create them for comments (unlike posts). Either way, its more important that they both use the same system ?> <thr:in-reply-to ref="<?php echo get_comment_link($parent_comment) ?>" href="<?php echo get_comment_link($parent_comment) ?>" type="<?php bloginfo_rss('html_type'); ?>" /> <?php endif; do_action('comment_atom_entry', $comment->comment_ID, $comment_post->ID); ?> </entry> <?php endwhile; endif; ?> </feed>
$comments = $wpdb->get_results("SELECT comment_ID, comment_author, comment_author_email, comment_author_url, comment_date, comment_content, comment_post_ID, $wpdb->posts.ID, $wpdb->posts.post_password FROM $wpdb->comments LEFT JOIN $wpdb->posts ON comment_post_id = id WHERE $wpdb->posts.post_status = 'publish' AND $wpdb->comments.comment_approved = '1' AND post_date < '".date("Y-m-d H:i:s")."' ORDER BY comment_date DESC LIMIT " . get_settings('posts_per_rss') ); } // this line is WordPress' motor, do not delete it. if ($comments) { foreach ($comments as $comment) { ?> <item> <title>by: <?php comment_author_rss() ?></title> <link><?php comment_link() ?></link> <pubDate><?php comment_time('r'); ?></pubDate> <guid><?php comment_link() ?></guid> <?php if (!empty($comment->post_password) && $_COOKIE['wp-postpass'] != $comment->post_password) { ?> <description>Protected Comments: Please enter your password to view comments.</description> <content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded> <?php } else { ?> <description><?php comment_text_rss() ?></description> <content:encoded><![CDATA[<?php comment_text() ?>]]></content:encoded> <?php } // close check for password ?> </item> <?php
function daiquiri_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; extract($args, EXTR_SKIP); ?> <div <?php comment_class(empty($args['has_children']) ? '' : 'parent'); ?> id="comment-<?php comment_ID(); ?> "> <div class="comment-header"> <p> <a href="<?php comment_link(); ?> "></a> <?php if ($comment->comment_approved == '0') { ?> <em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.'); ?> </em> <?php } ?> </p> </div> <div class="comment-body"> <?php comment_text(); ?> </div> <div class="comment-footer"> by <?php comment_author_link(get_comment_ID()); ?> , <?php comment_date(); ?> , <?php comment_time('H:i'); ?> <a href="<?php comment_link(); ?> ">Permalink</a> <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </div> </li> <?php }
function widget($args, $instance) { extract($args); global $wpdb; // call global for use in function $title_recent = empty($instance['title_recent']) ? __('Latest News', 'wpdance') : $instance['title_recent']; $title_comment = empty($instance['title_comment']) ? __('Comments', 'wpdance') : $instance['title_comment']; $num_recent = empty($instance['num_recent']) ? 5 : absint($instance['num_recent']); $num_comment = empty($instance['num_comment']) ? 5 : absint($instance['num_comment']); $thumbnail_width = 60; $thumbnail_height = 60; $_thumb_size = array(60, 60); echo $before_widget; wp_reset_query(); //add_image_size('tabs-post-thumbnail',$thumbnail_width,$thumbnail_height,true); ?> <div class="container-tabs"> <div id="tabs-post-sidebar" class="tabs-post-sidebar"> <ul class="nav nav-tabs wd-widget-multitabs"> <li class="first"><a href="#recent-tab"><span><span><?php echo esc_attr($title_recent); ?> </span></span></a></li> <li class="last"><a href="#comment-tab"><span><span><?php echo esc_attr($title_comment); ?> </span></span></a></li> </ul> <!-- Recent Tab --> <div class="tab-content"> <?php $r = new WP_Query(array('posts_per_page' => $num_recent, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true)); ?> <div id="recent-tab" class="tab-post-content tab-pane"> <div class='top-left'><div class='top-right'></div></div> <?php if ($r->have_posts()) { $i = 0; ?> <div class="contentcenter"> <ul class="recent-post-list tabs-post-list"> <?php while ($r->have_posts()) { global $post; $r->the_post(); ?> <li <?php if ($i == 0) { echo "class='first'"; } else { if ($i == $r->post_count - 1) { echo "class='last'"; } } ?> > <div class="image"> <a class="thumbnail" href="<?php the_permalink(); ?> "> <?php if (has_post_thumbnail()) { the_post_thumbnail('prod_tini_thumb', array('title' => esc_attr(get_the_title()), 'alt' => esc_attr(get_the_title()))); } ?> </a> <span class="shadow"></span> </div> <div class="content"> <p class="title"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></p> <span class="wpt-author-time"> <span class="author"><i class="icon-user custom-icon"></i><?php the_author(); ?> </span> <span class="time"><i class="icon-calendar custom-icon"></i><?php the_time(get_option('date_format')); ?> </span> <span class="comment-number"><i class="icon-comments-alt custom-icon"></i><?php comments_number('0 Comments', '1 Comment', '% Comments'); ?> </span> </span> </div> </li> <?php $i++; } ?> </ul> </div> <?php } ?> <?php wp_reset_query(); ?> <div class='bot-left'><div class='bot-right'></div></div> </div><!-- End #recent-tab --> <!-- Comment Tab --> <?php $recent_comments = get_comments(array('number' => $num_comment, 'status' => 'approve')); ?> <div id="comment-tab" class="tab-post-content tab-pane"> <div class='top-left'><div class='top-right'></div></div> <?php if (count($recent_comments)) { $i = 0; ?> <div class="contentcenter"> <ul class="tabs-comments-list"> <?php foreach ($recent_comments as $comment) { $GLOBALS['comment'] = $comment; switch ($comment->comment_type) { case '': $class = ""; if ($i == 0) { $class .= "first "; } if (++$i == count($recent_comments)) { $class .= "last"; } ?> <li <?php if ($class) { echo "class='{$class}'"; } ?> > <div class="avarta"><a href="<?php comment_link(); ?> "><?php echo get_avatar($comment, 58, get_bloginfo('template_url') . '/images/mycustomgravatar.png'); ?> </a></div> <div class="detail"> <div class="comment-author vcard"> <?php printf(__('%s', 'wpdance'), sprintf('<cite class="fn"><a href="%1$s" rel="external nofollow" class="url">%2$s</a></cite>', get_comment_author_url(), get_comment_author())); ?> : </div><!-- .comment-author .vcard --> <blockquote class="comment-body"><?php echo string_limit_words(get_comment_text(), 10); ?> </blockquote> <div class="comment-meta"><span><?php _e("in", "wpdance"); ?> <a href="<?php echo esc_url(get_permalink($comment->comment_post_ID)); ?> "><?php echo esc_attr(get_the_title($comment->comment_post_ID)); ?> </a></span></div> </div> </li> <?php break; case 'pingback': case 'trackback': break; } ?> <?php } ?> </ul> </div> <?php } ?> <?php wp_reset_query(); ?> <div class='bot-left'><div class='bot-right'></div></div> </div><!-- End #comment-multi-tab --> </div> </div> </div> <?php $rand_id = rand(); $random_id = "accordion-" . $rand_id; ?> <div class="accordion-tabs wd-widget-multitabs-accordion" id="<?php echo $random_id; ?> " style="display:none;"> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" href="#collapseTwo-<?php echo $rand_id; ?> " data-parent="#<?php echo $random_id; ?> " data-toggle="collapse"><span><span><?php echo esc_attr($title_recent); ?> </span></span></a> </div> <div class="accordion-body collapse" id="collapseTwo-<?php echo $rand_id; ?> "> <div class="accordion-inner"> </div> </div> </div> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" href="#collapseThree-<?php echo $rand_id; ?> " data-parent="#<?php echo $random_id; ?> " data-toggle="collapse"><span><span><?php echo esc_attr($title_comment); ?> </span></span></a> </div> <div class="accordion-body collapse" id="collapseThree-<?php echo $rand_id; ?> "> <div class="accordion-inner"> </div> </div> </div> </div> <script type="text/javascript"> //<![CDATA[ jQuery(function() { var windowWidth = jQuery(window).width(); jQuery( ".tabs-post-sidebar" ).tabs({ fx: { opacity: 'toggle', duration:'slow'} }).addClass( "ui-tabs-vertical ui-helper-clearfix" ); jQuery(window).resize(function() { windowWidth = jQuery(window).width(); if( jQuery.browser.msie && parseInt( jQuery.browser.version, 10 ) == 7 ){ jQuery.debounce(1000, function() { if(windowWidth >=200 && windowWidth <= 768){ jQuery(".widget_multitab > .accordion-tabs").each(function(index,value){ recentHtml = jQuery(value).siblings('.container-tabs').find('#recent-tab').html(); cmtHtml = jQuery(value).siblings('.container-tabs').find('#comment-tab').html(); jQuery(value).find('#collapseTwo-<?php echo $rand_id; ?> ').children().html(recentHtml); jQuery(value).find('#collapseThree-<?php echo $rand_id; ?> ').children().html(cmtHtml); jQuery(value).siblings('.container-tabs').hide(); jQuery(value).show().collapse({ toggle : false }); }); }else if( windowWidth >= 768 ){ jQuery(".widget_multitab > .accordion-tabs").each(function(index,value){ jQuery(value).hide().siblings('.container-tabs').show(); }); } }); }else{ if(windowWidth >=200 && windowWidth <= 768){ jQuery(".widget_multitab > .accordion-tabs").each(function(index,value){ recentHtml = jQuery(value).siblings('.container-tabs').find('#recent-tab').html(); cmtHtml = jQuery(value).siblings('.container-tabs').find('#comment-tab').html(); jQuery(value).find('#collapseTwo-<?php echo $rand_id; ?> ').children().html(recentHtml); jQuery(value).find('#collapseThree-<?php echo $rand_id; ?> ').children().html(cmtHtml); jQuery(value).siblings('.container-tabs').hide(); jQuery(value).show().collapse({ toggle : false }); }); }else if( windowWidth >= 768 ){ jQuery(".widget_multitab > .accordion-tabs").each(function(index,value){ jQuery(value).hide().siblings('.container-tabs').show(); //jQuery("#right-sidebar").css("height","auto"); }); } } }); if(windowWidth >=200 && windowWidth <= 768){ jQuery(".widget_multitab > .accordion-tabs").each(function(index,value){ recentHtml = jQuery(value).siblings('.container-tabs').find('#recent-tab').html(); cmtHtml = jQuery(value).siblings('.container-tabs').find('#comment-tab').html(); jQuery(value).find('#collapseTwo-<?php echo $rand_id; ?> ').children().html(recentHtml); jQuery(value).find('#collapseThree-<?php echo $rand_id; ?> ').children().html(cmtHtml); jQuery(value).siblings('.container-tabs').hide(); jQuery(value).show().collapse({ toggle : false }); }); } }); //]]> </script> <?php echo $after_widget; }
function ap_core_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class('media'); ?> id="li-comment-<?php comment_ID(); ?> "> <div id="comment-<?php comment_ID(); ?> " class="the_comment"> <div class="comment-author vcard"> <?php if (get_avatar($comment)) { ?> <div class="thumbnail media-object"><?php echo get_avatar($comment, $size = '64', $default = ''); ?> </div> <?php } ?> </div> <div class="media-body"> <label><?php echo sprintf(_x('On %1$s at %2$s, %3$s said:', '1: date, 2: time, 3:author', 'museum-core'), esc_html(get_comment_date()), esc_html(get_comment_time()), wp_kses_post(get_comment_author_link())); ?> </label> <?php if ($comment->comment_approved == '0') { ?> <em><?php _e('Your comment is awaiting moderation.', 'museum-core'); ?> </em> <br /> <?php } ?> <?php comment_text(); ?> <?php if (comments_open()) { if ($depth < $args['max_depth']) { ?> <div class="reply"><button class="btn btn-default btn-sm"> <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'reply_text' => __('Respond to this', 'museum-core'), 'max_depth' => $args['max_depth']))); ?> </button></div> <?php } } ?> <small> <div class="comment-meta commentmetadata"><?php edit_comment_link('<span class="text-danger">' . __('(Edit)', 'museum-core') . '</span>', '', ''); ?> </div> <a href="<?php comment_link(); ?> "><?php _e('Permalink', 'museum-core'); ?> </a> </small> </div> </div> </li> <?php }
function smittenkitchen_custom_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?> "> <article id="div-comment-<?php comment_ID(); ?> " class="comment-body"> <div class="comment-author vcard"> <b class="fn author-name"> <?php if (get_comment_author_url()) { ?> <a href="<?php comment_author_url(); ?> "><?php comment_author(); ?> </a> <?php } else { ?> <?php comment_author(); ?> <?php } ?> </b> </div><!-- .vcard --> <div class="comment-content"> <?php comment_text(); ?> </div> <footer class="comment-footer comment-metadata"> <time <?php comment_time('c'); ?> class="comment-time"> <a href=" <?php comment_link(); ?> "> <span class="date"><?php comment_date(); ?> </span> <?php echo esc_html_x('at', 'smittenkitchen', 'used between date and time'); ?> <span class="time"><?php comment_time(); ?> </span> </a> </time> <span class="edit-link"> <?php edit_comment_link(esc_html__('Edit', 'smittenkitchen')); ?> </span> <span class="reply-link"> <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </span><!-- .reply --> </footer><!-- .comment-footer --> </article><!-- #comment-<?php comment_ID(); ?> --> </li> <?php // End the default styling of comment }
/** * @param $comment stdClass * @param $args array * @param $depth int */ function cleanblog_callback_comments($comment, $args, $depth) { ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?> "> <div id="comment-<?php comment_ID(); ?> " class="media comment"> <div class="media-left"> <?php echo get_avatar($comment, $args['avatar_size']); ?> </div> <div class="media-body comment-body"> <h4 class="media-heading"> <?php if ($comment->comment_author_url) { ?> <a href="<?php echo $comment->comment_author_url; ?> "><?php comment_author(); ?> </a> <?php } else { ?> <?php comment_author(); ?> <?php } ?> <small> <a href="<?php comment_link(); ?> "><?php comment_date(); ?> <?php comment_time(); ?> </a> <?php echo comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => ' - '))); ?> </small> </h4> <?php comment_text(); ?> <?php if (!$comment->comment_approved) { ?> <div class="alert alert-info" role="alert"> <?php echo __('Your comment is awaiting moderation.'); ?> </div> <?php } ?> </div> </div> </li> <?php }
<?php if (post_password_required($comment_post)) { ?> <content type="html" xml:base="<?php comment_link(); ?> "><![CDATA[<?php echo get_the_password_form(); ?> ]]></content> <?php } else { // post pass ?> <content type="html" xml:base="<?php comment_link(); ?> "><![CDATA[<?php comment_text(); ?> ]]></content> <?php } // post pass // Return comment threading information (http://www.ietf.org/rfc/rfc4685.txt) if ($comment->comment_parent == 0) { // This comment is top level ?> <thr:in-reply-to ref="<?php the_guid(); ?>
function widget($args, $instance) { extract($args); global $wpdb; // call global for use in function $title_popular = empty($instance['title_popular']) ? __('Popular', 'wpdance') : $instance['title_popular']; $title_recent = empty($instance['title_recent']) ? __('Recent', 'wpdance') : $instance['title_recent']; $title_comment = empty($instance['title_comment']) ? __('Comments', 'wpdance') : $instance['title_comment']; $num_popular = empty($instance['num_popular']) ? 5 : absint($instance['num_popular']); $num_recent = empty($instance['num_recent']) ? 5 : absint($instance['num_recent']); $num_comment = empty($instance['num_comment']) ? 5 : absint($instance['num_comment']); echo $before_widget; $pc_rand_id = 'container-tabs-' . rand(0, 1000); ?> <div class="container-tabs" id="<?php echo $pc_rand_id; ?> "> <div id="tabs-post-sidebar" class="tabs-post-sidebar"> <ul class="nav nav-tabs wd-widget-multitabs"> <li class="first active"><a href="#popular-tab"><span><span><?php echo esc_attr($title_popular); ?> </span></span></a></li> <li class=""><a href="#recent-tab"><span><span><?php echo esc_attr($title_recent); ?> </span></span></a></li> <li class="last"><a href="#comment-tab"><span><span><?php echo esc_attr($title_comment); ?> </span></span></a></li> </ul> <div class="tab-content"> <!-- Popular Tab --> <div id="popular-tab" class="tab-post-content" style="display: block"> <div class='top-left'><div class='top-right'></div></div> <?php $args = array('posts_per_page' => $num_popular, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'meta_key' => '_wd_post_views_count', 'orderby' => 'meta_value_num', 'order' => 'desc'); $populars = new WP_Query($args); if ($populars->have_posts()) { $i = 0; ?> <div class="contentcenter"> <ul class="popular-post-list tabs-post-list"> <?php while ($populars->have_posts()) { global $post; $populars->the_post(); ?> <li <?php if ($i == 0) { echo "class='first'"; } else { if ($i == $populars->post_count - 1) { echo "class='last'"; } } ?> > <div class="image"> <a class="thumbnail" href="<?php the_permalink(); ?> "> <?php if (has_post_thumbnail()) { the_post_thumbnail('blog_tini_thumb', array('title' => esc_attr(get_the_title()), 'alt' => esc_attr(get_the_title()))); } ?> </a> <span class="shadow"></span> </div> <div class="content"> <h4 class="bold-upper"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h4> <span class="post-meta"> <span class="comment"><i class="fa fa-comments"></i><?php $comments_count = wp_count_comments($post->ID); echo $comments_count->approved; ?> </span> <span class="post-views"><i class="fa fa-eye"></i><?php wd_get_post_views(); ?> </span> <span class="date-time"><?php the_time(get_option('date_format')); ?> </span> </span> </div> </li> <?php $i++; } ?> </ul> </div> <?php } ?> <div class='bot-left'><div class='bot-right'></div></div> </div> <!-- Recent Tab --> <?php $r = new WP_Query(array('posts_per_page' => $num_recent, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true)); ?> <div id="recent-tab" class="tab-post-content" style="display: none"> <div class='top-left'><div class='top-right'></div></div> <?php if ($r->have_posts()) { $i = 0; ?> <div class="contentcenter"> <ul class="recent-post-list tabs-post-list"> <?php while ($r->have_posts()) { global $post; $r->the_post(); ?> <li <?php if ($i == 0) { echo "class='first'"; } else { if ($i == $r->post_count - 1) { echo "class='last'"; } } ?> > <div class="image"> <a class="thumbnail" href="<?php the_permalink(); ?> "> <?php if (has_post_thumbnail()) { the_post_thumbnail('blog_tini_thumb', array('title' => esc_attr(get_the_title()), 'alt' => esc_attr(get_the_title()))); } ?> </a> <span class="shadow"></span> </div> <div class="content"> <h4 class="bold-upper"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h4> <span class="post-meta"> <span class="comment"><i class="fa fa-comments"></i><?php $comments_count = wp_count_comments($post->ID); echo $comments_count->approved; ?> </span> <span class="post-views"><i class="fa fa-eye"></i><?php wd_get_post_views(); ?> </span> <span class="date-time"><?php the_time(get_option('date_format')); ?> </span> </span> </div> </li> <?php $i++; } ?> </ul> </div> <?php } ?> <div class='bot-left'><div class='bot-right'></div></div> </div><!-- End #recent-tab --> <!-- Comment Tab --> <?php $recent_comments = get_comments(array('number' => $num_comment, 'status' => 'approve')); ?> <div id="comment-tab" class="tab-post-content" style="display: none"> <div class='top-left'><div class='top-right'></div></div> <?php if (count($recent_comments)) { $i = 0; ?> <div class="contentcenter"> <ul class="tabs-comments-list"> <?php foreach ($recent_comments as $comment) { $GLOBALS['comment'] = $comment; switch ($comment->comment_type) { case '': $class = ""; if ($i == 0) { $class .= "first "; } if (++$i == count($recent_comments)) { $class .= "last"; } ?> <li <?php if ($class) { echo "class='{$class}'"; } ?> > <div class="avarta"><a href="<?php comment_link(); ?> "><?php echo get_avatar($comment, 58); ?> </a></div> <div class="detail"> <span class="comment-author vcard"> <?php printf(__('%s', 'wpdance'), sprintf('<cite class="fn"><a href="%1$s" rel="external nofollow" class="url">%2$s</a></cite>', get_comment_author_url(), get_comment_author())); ?> </span><!-- .comment-author .vcard --> <?php _e("in", "wpdance"); ?> <a class="bold-upper" href="<?php echo esc_url(get_permalink($comment->comment_post_ID)); ?> "><?php echo esc_attr(get_the_title($comment->comment_post_ID)); ?> </a> <blockquote class="comment-body"><?php echo string_limit_words(get_comment_text(), 10); ?> </blockquote> </div> </li> <?php break; case 'pingback': case 'trackback': break; } ?> <?php } ?> </ul> </div> <?php } ?> <div class='bot-left'><div class='bot-right'></div></div> </div> </div> </div> </div> <?php $rand_id = rand(); $random_id = "accordion-" . $rand_id; ?> <div class="accordion-tabs wd-widget-multitabs-accordion" id="<?php echo esc_attr($random_id); ?> " style="display:none;"> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" href="#collapseOne-<?php echo esc_attr($rand_id); ?> " data-parent="#<?php echo esc_attr($random_id); ?> " data-toggle="collapse"><span><span><?php echo esc_html($title_popular); ?> </span></span></a> </div> <div class="accordion-body collapse" id="collapseOne-<?php echo esc_attr($rand_id); ?> "> <div class="accordion-inner"> </div> </div> </div> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" href="#collapseTwo-<?php echo esc_attr($rand_id); ?> " data-parent="#<?php echo esc_attr($random_id); ?> " data-toggle="collapse"><span><span><?php echo esc_html($title_recent); ?> </span></span></a> </div> <div class="accordion-body collapse" id="collapseTwo-<?php echo esc_attr($rand_id); ?> "> <div class="accordion-inner"> </div> </div> </div> <div class="accordion-group"> <div class="accordion-heading"> <a class="accordion-toggle" href="#collapseThree-<?php echo esc_attr($rand_id); ?> " data-parent="#<?php echo esc_attr($random_id); ?> " data-toggle="collapse"><span><span><?php echo esc_html($title_comment); ?> </span></span></a> </div> <div class="accordion-body collapse" id="collapseThree-<?php echo esc_attr($rand_id); ?> "> <div class="accordion-inner"> </div> </div> </div> </div> <script type="text/javascript"> //<![CDATA[ jQuery(function() { "use strict"; var windowWidth = jQuery(window).width(); var pc_rand_id = '#<?php echo esc_js($pc_rand_id); ?> '; var mobile_rand_id = '#<?php echo esc_js($random_id); ?> '; jQuery(pc_rand_id+' .tabs-post-sidebar > ul > li a').bind('click', function(e){ e.preventDefault(); }); jQuery(pc_rand_id+' .tabs-post-sidebar > ul > li').bind('click', function(){ if( jQuery(this).hasClass('active') ){ return; } var current_id = jQuery(pc_rand_id+' .tabs-post-sidebar > ul > li.active').find('a').attr('href'); jQuery(pc_rand_id+' .tabs-post-sidebar > ul > li').removeClass('active'); var new_id = jQuery(this).find('a').attr('href'); jQuery(this).addClass('active'); jQuery(pc_rand_id+' .tab-content '+current_id).fadeOut(300, function(){ jQuery(pc_rand_id+' .tab-content '+new_id).fadeIn(300); }); }); jQuery(window).bind('multitab_resize', function(){ windowWidth = jQuery(window).width(); if( windowWidth < 768 ){ jQuery(pc_rand_id).hide(); jQuery(mobile_rand_id).show(); jQuery(mobile_rand_id +' .accordion-group').each(function(index,value){ var popular_html = jQuery(pc_rand_id+' .tab-content #popular-tab').html(); var recent_html = jQuery(pc_rand_id+' .tab-content #recent-tab').html(); var comment_html = jQuery(pc_rand_id+' .tab-content #comment-tab').html(); jQuery(value).find('#collapseOne-<?php echo esc_js($rand_id); ?> ').children().html(popular_html); jQuery(value).find('#collapseTwo-<?php echo esc_js($rand_id); ?> ').children().html(recent_html); jQuery(value).find('#collapseThree-<?php echo esc_js($rand_id); ?> ').children().html(comment_html); }); jQuery(mobile_rand_id +' .accordion-group a.accordion-toggle').unbind('click').bind('click', function(e){ e.preventDefault(); var group = jQuery(this).parents('.accordion-group'); group.find('.accordion-body').slideToggle(400); }); }else{ jQuery(pc_rand_id).show(); jQuery(mobile_rand_id).hide(); } }); jQuery(window).resize(function() { jQuery(window).trigger('multitab_resize'); }); jQuery(window).trigger('multitab_resize'); }); //]]> </script> <?php wp_reset_postdata(); echo $after_widget; }