function mb_entry_date_auth() { ob_start(); the_author_posts_link(); echo '<div class="entry-date-auth"> <time class="updated" datetime="' . get_the_time('c') . '">' . sprintf(__('%s', 'mb'), get_the_date()) . '</time>' . __(' By ', 'responsive-brix') . ob_get_clean() . '</div>'; }
echo "</div>"; } function _post() { ?> <!-- POSTS --> <div class="post"> <div class="posthead"> <span class="date"> <?php the_time('d/m/Y'); ?> </span><!-- /date --> <span class="autor"> <?php the_author_posts_link(); ?> </span> <?php //the_category(" | ") ?> </div><!-- /headpost --> <div class="postcontent"> <h1><a href="<?php the_permalink(); ?> " title="<?php the_title();
function mh_post_meta() { global $options; $post_date = isset($options['post_meta_date']) ? !$options['post_meta_date'] : true; $post_author = isset($options['post_meta_author']) ? !$options['post_meta_author'] : true; $post_cat = isset($options['post_meta_cat']) ? !$options['post_meta_cat'] : true; $post_comments = isset($options['post_meta_comments']) ? !$options['post_meta_comments'] : true; if ($post_date || $post_author || $post_cat || $post_comments) { echo '<p class="meta post-meta">'; if ($post_date || $post_author || $post_cat) { echo __('Posted ', 'mh'); } if ($post_date) { echo __('on ', 'mh') . '<span class="updated">' . get_the_date() . '</span>'; } if ($post_author) { echo __(' by ', 'mh') . '<span class="vcard author"><span class="fn">'; the_author_posts_link(); echo '</span></span>'; } if ($post_cat) { echo __(' in ', 'mh'); the_category(', '); } if ($post_date && $post_comments || $post_author && $post_comments || $post_cat && $post_comments) { echo ' // '; } if ($post_comments) { comments_number(__('0 Comments', 'mh'), __('1 Comment', 'mh'), __('% Comments', 'mh')); } echo '</p>' . "\n"; } }
function blog_thumbnail_style($atts, $current) { global $post, $mk_options; extract($atts); $image_height = $grid_image_height; if ($thumbnail_align == 'left') { $align_class = ' content-align-right'; } else { $align_class = ' content-align-left'; } if ($layout == 'full') { $image_width = $grid_width - 40; } else { $image_width = $content_width / 100 * $grid_width - 40; } $output = $has_image = ''; $post_type = get_post_meta($post->ID, '_single_post_type', true); /* * Image Width : 600px * Image Height : 460px */ $image_src_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full', true); $image_output_src = bfi_thumb($image_src_array[0], array('width' => '600', 'height' => '460')); if ($post_type == '') { $post_type = 'image'; } $output .= '<article id="' . get_the_ID() . '" class="mk-blog-thumbnail-item thumbnail-' . $item_id . ' mk-isotop-item ' . $post_type . '-post-type' . $align_class . '">' . "\n"; if (has_post_thumbnail()) { $output .= '<div class="featured-image" ><a href="' . get_permalink() . '" title="' . get_the_title() . '">'; $output .= ' <img alt="' . get_the_title() . '" title="' . get_the_title() . '" src="' . $image_output_src . '" itemprop="image" />'; $output .= ' <div class="image-hover-overlay"></div>'; $output .= ' <div class="post-type-badge" href="' . get_permalink() . '"><i class="mk-li-' . $post_type . '"></i></div>'; $output .= '</a></div>'; } $output .= '<div class="mk-thumbnail-content-container">'; $output .= ' <div class="mk-blog-meta">'; $output .= ' <div class="mk-blog-author">'; ob_start(); the_author_posts_link(); $output .= ob_get_contents() . '</div>'; ob_get_clean(); $output .= ' <span class="mk-categories"> / ' . __('', 'mk_framework') . ' ' . get_the_category_list(', ') . ' </span> / <time datetime="' . get_the_date() . '"> <a href="' . get_month_link(get_the_time("Y"), get_the_time("m")) . '">' . get_the_date() . '</a> </time>'; $output .= ' <h3 class="the-title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h3>'; if ($excerpt_length != 0) { ob_start(); the_excerpt_max_charlength($excerpt_length); $output .= '<div class="the-excerpt"><p>' . ob_get_clean() . '</p></div>'; } $output .= ' <div class="mk-teader-button">' . do_shortcode('[mk_button dimension="outline" corner_style="pointed" outline_skin="custom" outline_active_color="#000000" outline_hover_color="#fff" margin_bottom="0" size="medium" align="left" url="' . get_permalink() . '"]' . __('READ MORE', 'mk_framework') . '[/mk_button]') . ' </div>'; $output .= ' </div>'; $output .= ' </div>'; $output .= '<div class="clearboth"></div>'; $output .= '</article>' . "\n\n\n"; return $output; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? 'Popular This Week' : $instance['title']); $postsNum = empty($instance['postsNum']) ? '' : (int) $instance['postsNum']; $show_thisweek = isset($instance['thisweek']) ? (bool) $instance['thisweek'] : false; echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } $additional_query = $show_thisweek ? '&year=' . date('Y') . '&w=' . date('W') : ''; query_posts('post_type=post&posts_per_page=' . $postsNum . '&orderby=comment_count&order=DESC' . $additional_query); ?> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <div class="blog-entry"> <a href="<?php the_permalink(); ?> " class="comments"><?php comments_number('0', '1', '%'); ?> </a> <h4 class="title"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h4> <p class="meta-info"><?php esc_html_e('Posted', 'Aggregate'); ?> <?php esc_html_e('by', 'Aggregate'); ?> <?php the_author_posts_link(); ?> <?php esc_html_e('on', 'Aggregate'); ?> <?php the_time('n-j-y'); ?> </p> </div> <?php } } wp_reset_query(); ?> <?php echo $after_widget; }
/** * Post Meta * @since 1.7.0 */ function kouki_post_meta() { ?> <p class="meta"> <?php /** * Check for theme-options and echo the right meta-data for posts. */ $post_show_author = of_get_option('kouki_post_show_author'); $post_show_category = of_get_option('kouki_post_show_category'); $post_show_date = of_get_option('kouki_post_show_date'); $post_show_comments = of_get_option('kouki_post_show_comments'); if ($post_show_author || $post_show_date || $post_show_category) { _e('Posted ', 'kouki'); } if ($post_show_author) { _e('by ', 'kouki'); ?> <?php the_author_posts_link(); _e(' ', 'kouki'); } if ($post_show_date) { _e('on', 'kouki'); ?> <a href="<?php the_permalink(); ?> "><?php the_time('M j, Y '); ?> </a> <?php } if ($post_show_category && get_the_category()) { _e('in', 'kouki'); ?> <?php the_category(', '); } if (($post_show_author || $post_show_date || $post_show_category) && $post_show_comments) { echo "<br>"; } if ($post_show_comments) { ?> <a href="<?php comments_link(); ?> "><?php comments_number(__('No Comments', 'kouki'), __('One Comment', 'kouki'), __('% Comments', 'kouki')); ?> </a> <?php } ?> </p> <?php }
function get_author() { $author = get_newspapermeta('author', 0); if (!empty($author)) { echo $author; } else { the_author_posts_link(); } }
function authorWidget() { $settings = get_option("widget_authorwidget"); $title = $settings['title']; if ($title == "") { $title = __('Author Info', 'woothemes'); } if (is_single()) { ?> <div id="author" class="widget"> <h3 class="widget_title"><img src="<?php bloginfo('template_directory'); ?> /images/ico-author.png" alt="" /><?php echo $title; ?> </h3> <div class="wrap"> <div class="fl"><?php echo get_avatar(get_the_author_id(), '48'); ?> </div> <span class="author-info"><?php _e('This post was written by', 'woothemes'); ?> <?php the_author_posts_link(); ?> <?php _e('who has written', 'woothemes'); ?> <?php the_author_posts(); ?> <?php _e('posts on', 'woothemes'); ?> <a href="<?php echo get_option('home'); ?> /"><?php bloginfo('name'); ?> </a>.</span> <br class="fix"></br> <p class="author-desc"><?php the_author_description(); ?> </p> </div> </div> <?php } }
function pagelines_post_author_posts_link_shortcode($atts) { $defaults = array('before' => '', 'after' => ''); $atts = shortcode_atts($defaults, $atts); // Prevent automatic WP Output ob_start(); the_author_posts_link(); $author = ob_get_clean(); $output = sprintf('<span class="author vcard">%2$s<span class="fn">%1$s</span>%3$s</span>', $author, $atts['before'], $atts['after']); return apply_filters('pagelines_post_author_shortcode', $output, $atts); }
function ktz_author_box() { if (ot_get_option('ktz_active_autbox') == 'yes') { if (is_single()) { echo '<div class="ktz-authorbox"><div class="panel panel-default">'; echo '<div class="panel-heading clearfix">'; echo '<div class="pull-left">' . __('Author:', ktz_theme_textdomain) . ' '; echo the_author_posts_link(); echo '</div>'; echo '<ul class="ktz-socialicon pull-right">'; if (get_the_author_meta('twitter') != '' || get_the_author_meta('facebook') != '' || get_the_author_meta('googleplus') != '' || get_the_author_meta('url') != '') { if (get_the_author_meta('twitter') != '') { echo '<li class="twitter"><a target="_blank" href="http://twitter.com/'; echo the_author_meta('twitter'); echo '" title="' . __('Follow', ktz_theme_textdomain) . ' '; echo the_author_meta('display_name'); echo ' ' . __('on Twitter', ktz_theme_textdomain) . '"><span class="fontawesome ktzfo-twitter"></span></a></li>'; } if (get_the_author_meta('facebook') != '') { echo '<li class="facebook"><a target="_blank" href="'; echo the_author_meta('facebook'); echo '" title="' . __('Add', ktz_theme_textdomain) . ' '; echo the_author_meta('display_name'); echo ' ' . __('on facebook', ktz_theme_textdomain) . '"><span class="fontawesome ktzfo-facebook"></span></a></li>'; } if (get_the_author_meta('googleplus') != '') { echo '<li class="gplus"><a target="_blank" href="'; echo the_author_meta('googleplus'); echo '" title="' . __('Cycle', ktz_theme_textdomain) . ' '; echo the_author_meta('display_name'); echo ' ' . __('on googleplus', ktz_theme_textdomain) . '"><span class="fontawesome ktzfo-google-plus"></span></a></li>'; } if (get_the_author_meta('url') != '') { echo '<li class="rss"><a target="_blank" href="'; echo the_author_meta('url'); echo '" title="'; echo the_author_meta('display_name'); echo ' ' . __('site', ktz_theme_textdomain) . '"><span class="fontawesome ktzfo-rss"></span></a></li>'; } } echo '</ul>'; echo '</div>'; echo '<div class="panel-body clearfix">'; echo '<div class="ktz-author-thumb pull-left">'; echo get_avatar(get_the_author_meta('user_email'), $size = '52', '', $alt = 'author'); echo '</div>'; echo '<div class="ktz-author-desc">'; echo the_author_meta('description'); echo '</div>'; echo '</div>'; echo '</div></div>'; } } }
function sa_add_author_info($content) { ob_start(); the_author_posts_link(); $author_post_link = ob_get_contents(); ob_end_clean(); if (get_option('sa_add_to_content') == 'yes') { return $content . '</br><p>Author: ' . $author_post_link . '</p>'; } return $content; }
function genesis_post_author_posts_link_shortcode($atts) { $defaults = array('before' => '', 'after' => ''); $atts = shortcode_atts($defaults, $atts); // Darn you, WordPress! ob_start(); the_author_posts_link(); $author = ob_get_clean(); $output = sprintf('<span class="author vcard">%2$s<span class="fn">%1$s</span>%3$s</span>', $author, $atts['before'], $atts['after']); return apply_filters('genesis_post_author_shortcode', $output, $atts); }
function widget($args, $instance) { extract($args); $instance = wp_parse_args((array) $instance, array('title' => '', 'posts_cat' => '', 'posts_num' => '', 'posts_offset' => '', 'orderby' => '', 'order' => '', 'show_image' => 0, 'image_alignment' => '', 'image_size' => '', 'show_title' => 0, 'show_byline' => 0, 'show_content' => 0, 'content_limit' => '', 'more_text' => '')); echo $before_widget; $featured_posts = new WP_Query(array('cat' => $instance['posts_cat'], 'showposts' => $instance['posts_num'], 'offset' => $instance['posts_offset'], 'orderby' => $instance['orderby'], 'order' => $instance['order'])); if ($featured_posts->have_posts()) { while ($featured_posts->have_posts()) { $featured_posts->the_post(); echo '<li '; post_class('feature-post'); echo '>'; if (!empty($instance['show_image'])) { echo '<a href="' . get_permalink() . '" title="' . get_the_title() . '" class="' . esc_attr($instance['image_alignment']) . ' feature-image">'; genesis_image(array('format' => 'html', 'size' => $instance['image_size'])); echo '</a>'; } if (!empty($instance['show_title'])) { echo '<h2 class="title"><a href="' . get_permalink() . '" title="' . esc_attr(get_the_title()) . '">' . get_the_title() . '</a></h2>'; } if (!empty($instance['show_byline'])) { echo '<p class="byline">'; the_time('F j, Y'); echo ' ' . __('by', 'genesis') . ' '; the_author_posts_link(); echo ' · '; comments_popup_link(__('Leave a Comment', 'genesis'), __('1 Comment', 'genesis'), __('% Comments', 'genesis')); echo ' '; edit_post_link(__('(Edit)', 'genesis'), '', ''); echo '</p>'; } if (!empty($instance['show_content'])) { if ($instance['show_content'] == 'excerpt') { the_excerpt(); } elseif ($instance['show_content'] == 'content-limit') { the_content_limit((int) $instance['content_limit'], esc_html($instance['more_text'])); } else { the_content(esc_html($instance['more_text'])); } } echo '</li><!--end post_class()-->' . "\n\n"; if (!empty($instance['show_slider_nav'])) { $slider_nav .= '<li><a href="#"></a></li>'; } } } echo $after_widget; echo '<div class="feature-nav ' . esc_attr($instance['image_alignment']) . '">'; echo '<ul>'; echo $slider_nav; echo '</ul></div>'; wp_reset_query(); }
function widget($args, $instance) { extract($args); if (!is_single()) { return; } $title = apply_filters('widget_title', $instance['title']); if (empty($title)) { $title = false; } $show_gravatar = $instance['show_gravatar'] == 1 ? true : false; $show_bio = $instance['show_bio'] == 1 ? true : false; echo $before_widget; if ($title) { echo $before_title; echo $title; echo $after_title; } ?> <div class="author-info cf"> <?php if ($show_gravatar) { echo get_avatar(get_the_author_meta('email'), '60'); } ?> <span><?php echo stripslashes(get_option('dt_lang_gen_postedby')); ?> <?php the_author_posts_link(); ?> </span> <?php if ($show_bio) { ?> <p><?php the_author_meta('description'); ?> </p> <?php } ?> </div><!-- .author-info --> <?php echo $after_widget; }
function mh_post_meta() { global $options; if (isset($options['post_meta']) ? !$options['post_meta'] : true) { echo '<p class="meta post-meta">' . __('Posted on ', 'mh') . '<span class="updated">' . get_the_date() . '</span>' . __(' by ', 'mh'); echo '<span class="vcard author"><span class="fn">'; the_author_posts_link(); echo '</span></span>' . __(' in ', 'mh'); the_category(', '); echo ' // '; comments_number(__('0 Comments', 'mh'), __('1 Comment', 'mh'), __('% Comments', 'mh')); echo '</p>' . "\n"; } }
function usp_author_link() { global $post, $usp_post_meta_IsSubmission, $usp_post_meta_Submitter, $usp_post_meta_SubmitterUrl; $isSubmission = get_post_meta($post->ID, $usp_post_meta_IsSubmission, true); $submissionAuthor = get_post_meta($post->ID, $usp_post_meta_Submitter, true); $submissionLink = get_post_meta($post->ID, $usp_post_meta_SubmitterUrl, true); if ($isSubmission && !empty($submissionAuthor)) { if (empty($submissionLink)) { echo '<span class="usp-author-link">' . $submissionAuthor . '</span>'; } else { echo '<span class="usp-author-link"><a href="' . $submissionLink . '">' . $submissionAuthor . '</a></span>'; } } else { the_author_posts_link(); } }
function widget_sideFeature() { $options = get_option("widget_sideFeature"); $numberOf = $options['number']; $category = $options['category']; $category = "&cat=" . $category; $showposts = "posts_per_page=" . $numberOf . $category; ?> <?php $featuredPosts = new WP_Query(); $featuredPosts->query($showposts); ?> <?php $i = 1; ?> <?php while ($featuredPosts->have_posts()) { $featuredPosts->the_post(); ?> <h3 class="side"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h3> <div class="meta"> <?php _e("By", "feed-me-seymour"); echo " "; the_author_posts_link(); ?> </div> <div class="storycontent <?php if ($numberOf == $i) { echo "noline"; } $i++; ?> "> <?php theme_excerpt('25'); ?> </div> <?php } }
function widget($args, $instance) { extract($args); $instance = wp_parse_args((array) $instance, array('title' => '', 'page_id' => '', 'show_image' => 0, 'image_alignment' => '', 'image_size' => '', 'show_title' => 0, 'show_byline' => 0, 'show_content' => 0, 'content_limit' => '', 'more_text' => '')); echo $before_widget; // Set up the author bio if (!empty($instance['title'])) { echo $before_title . apply_filters('widget_title', $instance['title']) . $after_title; } $featured_page = new WP_Query(array('page_id' => $instance['page_id'])); if ($featured_page->have_posts()) { while ($featured_page->have_posts()) { $featured_page->the_post(); echo '<div '; post_class(); echo '>'; if (!empty($instance['show_image'])) { printf('<a href="%s" title="%s" class="%s">%s</a>', get_permalink(), the_title_attribute('echo=0'), esc_attr($instance['image_alignment']), genesis_get_image(array('format' => 'html', 'size' => $instance['image_size']))); } if (!empty($instance['show_title'])) { printf('<h2><a href="%s" title="%s">%s</a></h2>', get_permalink(), the_title_attribute('echo=0'), the_title_attribute('echo=0')); } if (!empty($instance['show_byline'])) { echo '<p class="byline">'; the_time('F j, Y'); echo ' ' . __('by', 'genesis') . ' '; the_author_posts_link(); echo g_ent(' · '); comments_popup_link(__('Leave a Comment', 'genesis'), __('1 Comment', 'genesis'), __('% Comments', 'genesis')); echo ' '; edit_post_link(__('(Edit)', 'genesis'), '', ''); echo '</p>'; } if (!empty($instance['show_content'])) { if (empty($instance['content_limit'])) { the_content($instance['more_text']); } else { the_content_limit((int) $instance['content_limit'], esc_html($instance['more_text'])); } } echo '</div><!--end post_class()-->' . "\n\n"; } } echo $after_widget; wp_reset_query(); }
/** * Function for getting the current post's author in The Loop and linking to the author archive page. * This function was created because core WordPress does not have template tags with proper translation * and RTL support for this. An equivalent getter function for `the_author_posts_link()` would * instantly solve this issue. * * @since 1.0.0 * @access public * @param array $args * @return string */ function hoot_get_post_author($args = array()) { $html = ''; $defaults = array('text' => '%s', 'before' => '', 'after' => '', 'wrap' => '<span %s>%s</span>'); $args = wp_parse_args($args, $defaults); /* Output buffering to get the author posts link. */ ob_start(); the_author_posts_link(); $link = ob_get_clean(); /* A small piece of my soul just died. Kittens no longer purr. Dolphins lost the ability to swim with grace. */ if (!empty($link)) { $html .= $args['before']; $html .= sprintf($args['wrap'], hoot_get_attr('entry-author'), sprintf($args['text'], $link)); $html .= $args['after']; } return $html; }
/** * Get related questions [description] */ function dwqa_related_question($question_id = false, $number = 5, $echo = true) { if (!$question_id) { $question_id = get_the_ID(); } $tag_in = $cat_in = array(); $tags = wp_get_post_terms($question_id, 'dwqa-question_tag'); if (!empty($tags)) { foreach ($tags as $tag) { $tag_in[] = $tag->term_id; } } $category = wp_get_post_terms($question_id, 'dwqa-question_category'); if (!empty($category)) { foreach ($category as $cat) { $cat_in[] = $cat->term_id; } } $args = array('orderby' => 'rand', 'post__not_in' => array($question_id), 'showposts' => $number, 'ignore_sticky_posts' => 1, 'post_type' => 'dwqa-question'); $args['tax_query']['relation'] = 'OR'; if (!empty($cat_in)) { $args['tax_query'][] = array('taxonomy' => 'dwqa-question_category', 'field' => 'id', 'terms' => $cat_in, 'operator' => 'IN'); } if (!empty($tag_in)) { $args['tax_query'][] = array('taxonomy' => 'dwqa-question_tag', 'field' => 'id', 'terms' => $tag_in, 'operator' => 'IN'); } $related_questions = new WP_Query($args); if ($related_questions->have_posts()) { if ($echo) { echo '<ul>'; while ($related_questions->have_posts()) { $related_questions->the_post(); echo '<li><a href="' . get_permalink() . '" class="question-title">' . get_the_title() . '</a> ' . __('asked by', 'dwqa') . ' '; the_author_posts_link(); echo '</li>'; } echo '</ul>'; } } $posts = $related_questions->posts; wp_reset_postdata(); return $posts; }
function comicpress_dual_columns() { global $comicpress_options; ?> <div id="dualcolumns"> <div class="column_one"> <div class="column_one_header"></div> <?php $blog_query = 'showposts=' . $comicpress_options['blog_postcount'] . '&cat="-' . exclude_comic_categories() . '"&author=' . $comicpress_options['author_column_one'] . '&paged=' . $paged; $posts = query_posts($blog_query); if (have_posts()) { while (have_posts()) { the_post(); comicpress_display_post(); } } ?> <span class="viewpostsbyone">View all posts by: <?php the_author_posts_link(); ?> <span><br /> </div> <div class="column_two"> <div class="column_two_header"></div> <?php $blog_query = 'showposts=' . $comicpress_options['blog_postcount'] . '&cat="-' . exclude_comic_categories() . '"&author=' . $comicpress_options['author_column_two']; $posts = query_posts($blog_query); if (have_posts()) { while (have_posts()) { the_post(); comicpress_display_post(); } } ?> <span class="viewpostsbytwo">View all posts by: <?php the_author_posts_link(); ?> </span><br /> </div> <div class="clear"></div> </div> <?php }
/** * Use to put an author box at the end/beginning of a post. This template * tag should be used within The Loop. * * @since 0.1 * @uses get_avatar() Gets the current author's avatar. * @uses get_the_author_meta() Grabs information about the author. */ function members_author_profile() { ?> <div class="author-profile vcard"> <?php echo get_avatar(get_the_author_meta('user_email'), '100', '', get_the_author_meta('display_name')); ?> <h4 class="author-name fn n"><?php the_author_posts_link(); ?> </h4> <p class="author-description author-bio"> <?php the_author_meta('description'); ?> </p> </div> <?php }
function sociallyviral_posted_on() { ?> <div class="entry-meta post-info"> <span class="theauthor"><i class="icon-user"></i> <span itemprop="author"><?php the_author_posts_link(); ?> </span></span> <span class="thetime updated"><i class="icon-calendar"></i> <span itemprop="datePublished"><?php the_time(get_option('date_format')); ?> </span></span> <span class="thecomment"><i class="icon-chat"></i> <a rel="nofollow" href="<?php echo esc_url(get_comments_link()); ?> " itemprop="interactionCount"><?php comments_number(); ?> </a></span> </div><!-- .entry-meta --> <?php }
function nice_post_meta() { ?> <p class="post-meta"> <span class="post-author"><span class="small"><?php _e('By', 'nicethemes'); ?> </span> <?php the_author_posts_link(); ?> </span> | <span class="post-date"><span class="small"><?php _e('On', 'nicethemes'); ?> </span> <?php the_time(get_option('date_format')); ?> </span> | <span class="post-category"><span class="small"><?php _e('in', 'nicethemes'); ?> </span> <?php the_category(', '); ?> </span> <span class="post-comments"><span class="small"><?php _e('with', 'nicethemes'); ?> </span> <?php comments_popup_link(__('No Comments', 'nicethemes'), __('1 Comment', 'nicethemes'), __('% Comments', 'nicethemes')); ?> </span> <?php edit_post_link(__('{ Edit }', 'nicethemes'), '<span class="small">', '</span>'); ?> </p> <?php }
function jr_blog_post_meta() { if (is_page()) { return; } // don't do post-meta on pages global $post; ?> <p class="meta"><em><?php _e('Posted by', 'appthemes'); ?> </em> <?php the_author_posts_link(); ?> | <?php echo jr_ad_posted($post->post_date); ?> | <?php the_category(', '); ?> </p> <?php }
<h2 class="et_pt_title"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h2> <p class="et_pt_blogmeta"><?php esc_html_e('Posted', 'Modest'); ?> <?php esc_html_e('by', 'Modest'); ?> <?php the_author_posts_link(); ?> <?php esc_html_e('on', 'Modest'); ?> <?php the_time(get_option('modest_date_format')); ?> <?php esc_html_e('in', 'Modest'); ?> <?php the_category(', '); ?> | <?php comments_popup_link(esc_html__('0 comments', 'Modest'), esc_html__('1 comment', 'Modest'), '% ' . esc_html__('comments', 'Modest'));
public function widget($args, $instance) { extract($args); global $wpdb, $post; $title = apply_filters('widget_title', $instance['title']); $post_num = isset($instance['post-quantity']) ? $instance['post-quantity'] : 5; $post_type = isset($instance['post-type']) ? $instance['post-type'] : 'post'; $sort_by = isset($instance['sort-by']) ? $instance['sort-by'] : 'date'; $sort_order = isset($instance['sort-order']) ? $instance['sort-order'] : false; if ($sort_order) { $order = 'ASC'; } else { $order = 'DESC'; } $show_date = isset($instance['date']) ? $instance['date'] : false; $show_comments = isset($instance['comments']) ? $instance['comments'] : false; $categories = isset($instance['category']) ? $instance['category'] : ''; $show_excerpt = isset($instance['excerpt']) ? $instance['excerpt'] : false; $excerpt_length = isset($instance['excerpt-length']) ? $instance['excerpt-length'] : 10; $excerpt_more = isset($instance['excerpt-more']) ? $instance['excerpt-more'] : '...read more'; // Excerpt filters $new_excerpt_more = create_function('$more', 'return " ";'); add_filter('excerpt_more', $new_excerpt_more); $new_excerpt_length = create_function('$length', 'return "' . $excerpt_length . '";'); if ($excerpt_length > 0) { add_filter('excerpt_length', $new_excerpt_length); } $show_thumb = isset($instance['thumb']) ? $instance['thumb'] : false; $show_price = isset($instance['price']) ? $instance['price'] : false; $cur_postID = $post->ID; // The Query $query_args = array('ignore_sticky_posts' => 1, 'posts_per_page' => $post_num, 'orderby' => $sort_by, 'order' => $order, 'post_type' => $post_type, 'post_status' => 'publish', 'cat' => $categories); $the_query = new WP_Query($query_args); echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } echo '<ul class="recent-post-list">'; while ($the_query->have_posts()) { $the_query->the_post(); // Frontend Output ?> <li class="recent-post-item"> <?php if ($show_thumb && has_post_thumbnail()) { ?> <div class="thumb-wrapper"> <a class="recent-posts-img-link" rel="bookmark" href="<?php the_permalink(); ?> " title="Click to learn more about <?php the_title(); ?> "> <?php the_post_thumbnail('shortcode-thumb-short'); ?> </a> </div> <?php } // Post Thumbnail ?> <h4> <a href="<?php the_permalink(); ?> " class="nav-button" rel="bookmark" title="Click to learn more about <?php the_title(); ?> "><?php the_title(); ?> </a> </h4> <?php if ($show_date || $show_comments) { ?> <div class="recent-posts-entry-meta"> <?php if ($show_date) { ?> <div class="post-date"><?php the_time('F jS, Y'); ?> <span class="post-author"> by <?php the_author_posts_link(); ?> </span></div> <?php } // Post Date & Author ?> <?php if ($show_comments) { ?> <div class="comments-qty"><?php comments_popup_link('No comments yet', '1 comment', '% comments', 'comments-link', 'Comments are off for this post'); ?> </div> <?php } // Post Comments ?> </div> <?php } ?> <?php if ($show_excerpt) { ?> <div class="recent-posts-entry-content"><?php the_excerpt(); ?> <a href="<?php the_permalink(); ?> " class="more-link" rel="bookmark" title="Read more about <?php the_title(); ?> "><?php echo $excerpt_more; ?> </a> </div> <?php } // Post Content ?> <?php if ($show_price && $post_type != 'product') { continue; } else { if ($post_type === 'product') { echo '<div class="product-price">'; woocommerce_template_single_price(); echo '</div>'; // Product Price if WOO } elseif ($post_type === 'wpsc-product') { echo '<div class="product-price">'; wpsc_the_product_price_display(); echo '</div>'; // Product Price if WPEC } else { continue; } } ?> </li> <?php } echo '</ul>'; echo $after_widget; wp_reset_postdata(); }
function print_blog_full($item_class, $item_size, $num_excerpt, $full_content = "No") { global $gdl_admin_translator, $more, $gdl_date_format; if ($full_content == 'Yes') { $more = 0; } if ($gdl_admin_translator == 'enable') { $translator_continue_reading = get_option(THEME_SHORT_NAME . '_translator_continue_reading', 'Continue Reading'); } else { $translator_continue_reading = __('Continue Reading', 'gdl_front_end'); } while (have_posts()) { the_post(); echo '<div class="' . $item_class . '">'; // blog thumbnail print_blog_thumbnail(get_the_ID(), $item_size); echo '<div class="blog-content-wrapper">'; // blog title echo '<h2 class="blog-title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>'; // blog information echo '<div class="blog-info-wrapper">'; echo '<div class="blog-comment"><i class="icon-comments"></i>'; comments_popup_link(__('0 Comment', 'gdl_front_end'), __('1 Comment', 'gdl_front_end'), __('% Comments', 'gdl_front_end'), '', __('Comment are off', 'gdl_front_end')); echo '</div>'; echo '<div class="blog-author"><i class="icon-user"></i>'; echo the_author_posts_link(); echo '</div>'; $tags_opening = '<div class="blog-tag"><i class="icon-tags"></i>'; $tags_ending = '</div>'; the_tags($tags_opening, ', ', $tags_ending); echo '<div class="clear"></div>'; echo '</div>'; // blog information // blog content echo '<div class="blog-content">'; if ($full_content == "No") { if (get_post_type() == 'package') { echo do_shortcode(get_the_excerpt()); } else { echo gdl_get_excerpt($num_excerpt, '... '); } echo '<div class="clear"></div>'; echo '<a class="blog-continue-reading" href="' . get_permalink() . '"> ' . $translator_continue_reading . '</a>'; } else { the_content($translator_continue_reading); } echo '</div>'; echo '</div>'; // blot content wrapper echo '</div>'; // blog item } }
<?php get_header(); ?> <h1 class="archive_title"><span>Search Results for:</span> <?php echo esc_attr(get_search_query()); ?></h1> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?>> <div class="article"> <header> <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> <p class="meta">Posted <time><?php the_time('F jS, Y'); ?></time> by <?php the_author_posts_link(); ?> <span class="amp">&</span> filed under <?php the_category(', '); ?>.</p> </header> <!-- end article header --> <section class="post_content"> <?php the_excerpt('<span class="read-more">Read more on "'.the_title('', '', false).'" »</span>'); ?> </section> <!-- end article section --> <footer> </footer> <!-- end article footer --> </div> </article> <!-- end article -->
function avada_render_rich_snippets_for_pages() { global $smof_data; $html = ''; if (!is_404()) { $html = '<span class="entry-title" style="display: none;">' . get_the_title() . '</span>'; } ob_start(); the_author_posts_link(); $author_post_link = ob_get_clean(); $html .= '<span class="vcard" style="display: none;"><span class="fn">' . $author_post_link . '</span></span>'; if (!$smof_data['disable_date_rich_snippet_pages']) { $html .= '<span class="updated" style="display:none;">' . get_the_modified_time('c') . '</span>'; } return $html; }