/** * Displays Attachment Image Thumbnail * * @since rtPanel 2.0 * @param Integer $post_id for which post thumbnail will be fetched * @param String $thumbnail_size size of the thumbnail required. Default is thumbnail * @param String $default_img_path The path to the default image ( in case of no thumbnail found ) */ function rtp_show_post_thumbnail($post_id = null, $thumbnail_size = 'thumbnail', $default_img_path = '') { global $rtp_post_comments; if (!is_singular() && $rtp_post_comments['summary_show'] && $rtp_post_comments['thumbnail_show'] && !rtp_is_bbPress()) { $thumbnail_frame = $rtp_post_comments['thumbnail_frame'] ? 'rtp-thumbnail-shadow' : 'rtp-no-thumbnail-shadow'; $image_align = 'align' . strtolower($rtp_post_comments['thumbnail_position']); if (has_post_thumbnail()) { echo '<figure class="rtp-thumbnail-container ' . esc_attr($image_align) . ' ' . $thumbnail_frame . '">'; ?> <a role="link" class="<?php echo esc_attr($image_align); ?> " href="<?php echo get_permalink(); ?> " title="<?php the_title_attribute(); ?> "><?php the_post_thumbnail($thumbnail_size, array('title' => the_title_attribute(array('echo' => false)), 'class' => 'post-thumb ' . $image_align)); ?> </a><?php echo '</figure>'; } else { $image = apply_filters('rtp_default_image_path', $default_img_path); if (isset($image) && !empty($image)) { $image_id = rtp_get_attachment_id_from_src($image, true); $alt = get_post_meta($image_id, '_wp_attachment_image_alt', true) ? get_post_meta($image_id, '_wp_attachment_image_alt', true) : 'Image'; echo '<figure class="rtp-thumbnail-container ' . esc_attr($image_align) . ' ' . $thumbnail_frame . '">'; ?> <a role="link" class="<?php echo esc_attr($image_align); ?> " href="<?php echo get_permalink(); ?> " title="<?php the_title_attribute(); ?> "><img role="img" class="<?php echo 'post-thumb ' . esc_attr($image_align); ?> wp-post-image" title="<?php the_title_attribute(); ?> " alt="<?php echo esc_attr($alt); ?> " <?php echo rtp_get_image_dimensions($image); ?> src="<?php echo esc_attr($image); ?> " /></a><?php echo '</figure>'; } } } }
/** * Outputs the comment count linked to the comments of the particular post/page * * @since rtPanel 2.1 */ function rtp_default_comment_count() { global $rtp_post_comments; // Comment Count add_filter('get_comments_number', 'rtp_only_comment_count', 11, 2); if ((get_comments_number() || @comments_open()) && !is_attachment() && !rtp_is_bbPress() || is_attachment() && $rtp_post_comments['attachment_comments']) { // If post meta is set to top then only display the comment count. ?> <span class="rtp-meta-separator">·</span> <span class="rtp-post-comment-count"><?php comments_popup_link(_x('Leave a comment', 'comments number', 'rtPanel'), _x('<span>1</span> Comment', 'comments number', 'rtPanel'), _x('<span>%</span> Comments', 'comments number', 'rtPanel'), 'rtp-post-comment rtp-common-link'); ?> </span><?php } remove_filter('get_comments_number', 'rtp_only_comment_count', 11, 2); }
<?php rtp_hook_post_meta('top'); ?> </header><!-- .post-title --> <div class="post-content"> <?php rtp_hook_begin_post_content(); ?> <?php rtp_show_post_thumbnail(); ?> <?php if (is_singular() || !$rtp_post_comments['summary_show'] || rtp_is_bbPress() || rtp_is_rtmedia()) { the_content(__('Read More →', 'rtPanel')); wp_link_pages(array('before' => '<div class="page-link clearfix">' . __('Pages:', 'rtPanel'), 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>')); } else { @the_excerpt(); } ?> <?php rtp_hook_end_post_content(); ?> </div><!-- .post-content --> <?php rtp_hook_post_meta('bottom'); ?>