function twentysixteen_entry_meta()
{
    ob_start();
    if ('post' === get_post_type()) {
        ob_start();
        twentysixteen_entry_date();
        $postedOn = ob_get_clean();
        $author_avatar_size = apply_filters('twentysixteen_author_avatar_size', 49);
        printf('<div class="name-date"><div class="name"><span class="screen-reader-text">%2$s </span> <a class="url fn n" href="%3$s">%4$s</a></div><div class="date">%5$s</div></div><div class="avatar">%1$s</div>', get_avatar(get_the_author_meta('user_email'), $author_avatar_size), _x('Author', 'Used before post author name.', 'twentysixteen'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author(), $postedOn);
    }
    if (in_array(get_post_type(), array('attachment'))) {
        twentysixteen_entry_date();
    }
    $authordate = ob_get_clean();
    printf('<div class="author-date">%s</div>', $authordate);
    $format = get_post_format();
    if (current_theme_supports('post-formats', $format)) {
        printf('<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', sprintf('<span class="screen-reader-text">%s </span>', _x('Format', 'Used before post format.', 'twentysixteen')), esc_url(get_post_format_link($format)), get_post_format_string($format));
    }
    echo '<div class="taxonomies">';
    if ('post' === get_post_type()) {
        twentysixteen_entry_taxonomies();
    }
    echo '</div>';
    if (!is_singular() && !post_password_required() && (comments_open() || get_comments_number())) {
        echo '<span class="comments-link">';
        comments_popup_link(sprintf(__('Leave a comment<span class="screen-reader-text"> on %s</span>', 'twentysixteen'), get_the_title()));
        echo '</span>';
    }
}
 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function square_posted_on()
 {
     $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
     if (get_the_time('U') !== get_the_modified_time('U')) {
         $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
     }
     $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
     $posted_on = sprintf(esc_html_x('%s', 'post date', 'square'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
     $byline = sprintf(esc_html_x('by %s', 'post author', 'square'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>');
     $comment_count = get_comments_number();
     // get_comments_number returns only a numeric value
     if (comments_open()) {
         if ($comment_count == 0) {
             $comments = __('No Comments', 'square');
         } elseif ($comment_count > 1) {
             $comments = $comment_count . __(' Comments', 'square');
         } else {
             $comments = __('1 Comment', 'square');
         }
         $comment_link = '<a href="' . get_comments_link() . '">' . $comments . '</a>';
     } else {
         $comment_link = __(' Comment Closed', 'square');
     }
     echo '<span class="posted-on"><i class="fa fa-clock-o"></i>' . $posted_on . '</span><span class="byline"> ' . $byline . '</span><span class="comment-count"><i class="fa fa-comments-o"></i>' . $comment_link . "</span>";
     // WPCS: XSS OK.
 }
Example #3
0
 function flatbook_post_metas()
 {
     $user = get_the_author();
     $date = get_the_date('F j');
     $cats = get_the_category();
     $tags = get_the_tags();
     $comm = get_comments_number();
     $type = get_post_format();
     if (false === $type) {
         $type = __('standard', 'flatbook');
     }
     echo '<div class="entry-metas">';
     if ($type) {
         echo '<span class="format"><i class="fa fa-inbox"></i>' . $type . '</span>';
     }
     if ($date) {
         echo '<span class="posted-on"><i class="fa fa-dashboard"></i>' . $date . '</span>';
     }
     if ($user) {
         echo '<span class="byline"><i class="fa fa-user"></i>' . $user . '</span>';
     }
     if ($cats) {
         echo '<span class="cats"><i class="fa fa-folder-open"></i>' . $cats[0]->cat_name . '</span>';
     }
     if ($tags) {
         echo '<span class="tags"><i class="fa fa-tags"></i>' . $tags[0]->name . '</span>';
     }
     if ($comm) {
         echo '<span class="comments"><i class="fa fa-comments"></i>' . $comm . __(' Comment', 'flatbook') . '</span>';
     }
     echo '</div>';
 }
 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function pleiadesweb_posted_on()
 {
     // POSTED ON
     $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
     if (get_the_time('U') !== get_the_modified_time('U')) {
         $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
     }
     $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
     $posted_on = sprintf('<i class="fa fa-calendar"></i>' . esc_html_x(' %s', 'post date', 'pleiadesweb'), '<a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a>');
     // AUTHOR
     $byline = sprintf(esc_html_x('| escrito por %s', 'post author', 'pleiadesweb'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>');
     echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>';
     // CATEGORIES
     /* translators: used between list items, there is a space after the comma */
     $categories_list = get_the_category_list(esc_html__(', ', 'pleiadesweb'));
     if ($categories_list && pleiadesweb_categorized_blog()) {
         echo ' | </i><span class="category-list">' . $categories_list . '</span>';
     }
     // COMMENTS
     if (!post_password_required() && (comments_open() || '0' != get_comments_number())) {
         echo ' | <span class="comments-link">';
         comments_popup_link(__('Deja un comentario', 'my-simone'), __('1 comentario', 'my-simone'), __('% comentarios', 'my-simone'));
         echo '</span>';
     }
     //!post_password_required()
 }
function wpsr_floatingbts_commentbt($args)
{
    global $post;
    $defaults = array('type' => 'vertical');
    $args = wp_parse_args($args, $defaults);
    extract($args, EXTR_SKIP);
    $comments_num = get_comments_number();
    if (comments_open()) {
        if ($type == 'vertical') {
            return '<div class="wpsr_commentsbt">
				<div class="wpsr_cmt_bubble" title="Comments"><a href="' . get_comments_link() . '">' . $comments_num . '</a></div>
				<div class="wpsr_cmt_button"><a href="' . get_comments_link() . '">Comment</a></div>
			</div>';
        } else {
            if ($comments_num == 0) {
                $comments = __('No Comments');
            } elseif ($comments_num > 1) {
                $comments = $comments_num . __(' Comments');
            } else {
                $comments = __('1 Comment');
            }
            return '<a href="' . get_comments_link() . '">' . $comments . '</a>';
        }
    } else {
        return '';
    }
}
 /**
  * Display related projects.
  *
  */
 function presscore_display_related_projects()
 {
     global $post;
     $html = '';
     $config = presscore_get_config();
     // if related projects turn on in theme options
     if ($config->get('post.related_posts.enabled')) {
         $terms = array();
         switch ($config->get('post.related_posts.query.mode')) {
             case 'custom':
                 $terms = $config->get('post.related_posts.query.terms');
                 break;
             default:
                 $terms = wp_get_object_terms($post->ID, 'dt_portfolio_category', array('fields' => 'ids'));
         }
         if ($terms && !is_wp_error($terms)) {
             $options = array('cats' => $terms, 'select' => 'only', 'post_type' => 'dt_portfolio', 'taxonomy' => 'dt_portfolio_category', 'args' => array('posts_per_page' => intval($config->get('post.related_posts.query.posts_per_page')), 'post__not_in' => array(get_the_ID())));
             $posts = presscore_get_posts_in_categories($options);
             $portfolio_scroller = new Presscore_Portfolio_Posts_Scroller();
             $portfolio_scroller->setup($posts, array('class' => 'related-projects slider-wrapper', 'width' => $config->get('post.related_posts.width'), 'height' => $config->get('post.related_posts.height'), 'show_title' => $config->get('post.related_posts.show.title'), 'show_excerpt' => $config->get('post.related_posts.show.description'), 'appearance' => 'under_image', 'padding' => 20, 'bg_under_projects' => false, 'content_aligment' => 'center', 'hover_animation' => 'fade', 'hover_bg_color' => 'accent', 'hover_content_visibility' => 'on_hoover', 'show_link' => $config->get('post.related_posts.show.link'), 'show_details' => $config->get('post.related_posts.show.details_link'), 'show_zoom' => $config->get('post.related_posts.show.zoom'), 'show_date' => $config->get('post.related_posts.meta.fields.date'), 'show_categories' => $config->get('post.related_posts.meta.fields.categories'), 'show_comments' => $config->get('post.related_posts.meta.fields.comments'), 'show_author' => $config->get('post.related_posts.meta.fields.author'), 'arrows' => 'accent'));
             $html .= $portfolio_scroller->get_html();
             if ($html) {
                 $html = '<div class="full-width-wrap">' . $html . '</div>';
                 // fancy separator
                 $html = presscore_fancy_separator(array('title' => $config->get('post.related_posts.title'), 'class' => 'fancy-projects-title')) . $html;
                 if (!(post_password_required() || !comments_open() && 0 == get_comments_number())) {
                     // add gap after projects
                     $html .= do_shortcode('[dt_gap height="40"]');
                 }
             }
         }
     }
     echo (string) apply_filters('presscore_display_related_projects', $html);
 }
Example #7
0
 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function impronta_metadata()
 {
     // Hide category and tag text for pages.
     if ('post' === get_post_type()) {
         echo '<p class="metadata">';
         $byline = sprintf(esc_html_x('By %s', 'post author', 'impronta'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span> ');
         echo $byline;
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', 'impronta'));
         if ($categories_list && impronta_categorized_blog()) {
             printf('<span class="cat-links">' . esc_html_x('on %1$s ', 'on categories', 'impronta') . '</span>', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', 'impronta'));
         if ($tags_list) {
             printf(esc_html__('tagged %1$s', 'impronta'), $tags_list);
             // WPCS: XSS OK.
         }
         if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
             if (get_comments_number(get_the_id()) == 0) {
                 echo esc_html__('- ', 'impronta');
             } else {
                 echo esc_html__('with ', 'impronta');
             }
             comments_popup_link(esc_html__('Leave a comment', 'impronta'), esc_html__('1 Comment', 'impronta'), esc_html__('% Comments', 'impronta'));
         }
         if (is_sticky()) {
             echo ' - ' . '<i class="feature-star fa fa-star" data-toggle="tooltip" data-placement="right" title="' . esc_attr__('Featured Post', 'impronta') . '"></i>';
         }
         echo '</p>';
     }
 }
Example #8
0
 /**
  * Eighteen tags display comments
  * @since  1.0.0
  */
 function eighteen_tags_display_comments()
 {
     // If comments are open or we have at least one comment, load up the comment template
     if (comments_open() || '0' != get_comments_number()) {
         comments_template();
     }
 }
function vca_comments_template()
{
    // If comments are open or we have at least one comment, load up the comment template
    if (CA_Option::get('enable_comments', true) && (comments_open() || '0' != get_comments_number())) {
        comments_template();
    }
}
Example #10
0
    /**
     * Prints HTML with meta information for the categories, tags and comments.
     */
    function hacker_entry_footer()
    {
        // Hide category and tag text for pages.
        ?>
	<div class="Article__meta pull-left">
	<?php 
        if ('post' === get_post_type()) {
            echo get_the_tag_list('<span class="post-tags"><i class="icon-tags"></i>', '', '</span>');
        }
        ?>
	</div>
	<!-- END .pull-left -->
	<div class="Article__meta pull-right">
	<?php 
        $post_id = get_the_ID();
        $likes = get_post_meta($post_id, '_likes', true);
        $likes = absint($likes);
        printf('<span><a href="#" class="js-rating" data-post="%1$s"><i class="icon-heart"></i><span class="js-count">%2$s</span></a></span>', $post_id, $likes);
        if (!post_password_required() && (comments_open() || get_comments_number())) {
            echo '<span><i class="icon-comments"></i><span>';
            comments_popup_link(esc_html__('No Comment', 'hacker'), esc_html__('1 Comment', 'hacker'), esc_html__('% Comments', 'hacker'));
            echo '</span></span>';
        }
        ?>
	</div>
	<!-- END .pull-right -->
<?php 
    }
function hocwp_theme_check_load_facebook_javascript_sdk($use)
{
    $data = apply_filters('hocwp_load_facebook_javascript_sdk_on_page_sidebar', array());
    foreach ($data as $value) {
        $conditional_functions = isset($value['condition']) ? $value['condition'] : '';
        $conditional_functions = hocwp_sanitize_array($conditional_functions);
        $condition_result = false;
        foreach ($conditional_functions as $function) {
            if (!hocwp_callback_exists($function)) {
                continue;
            }
            if (call_user_func($function)) {
                $condition_result = true;
                break;
            }
        }
        $sidebar = isset($value['sidebar']) ? $value['sidebar'] : '';
        $sidebars = hocwp_sanitize_array($sidebar);
        foreach ($sidebars as $sidebar) {
            if (is_active_sidebar($sidebar) && $condition_result && hocwp_sidebar_has_widget($sidebar, 'hocwp_widget_facebook_box')) {
                return true;
            }
        }
    }
    $comment_system = hocwp_theme_get_option('comment_system', 'discussion');
    if ('facebook' == $comment_system || 'default_and_facebook' == $comment_system || 'tabs' == $comment_system) {
        if (is_singular()) {
            $post_id = get_the_ID();
            if (comments_open($post_id) || get_comments_number($post_id)) {
                return true;
            }
        }
    }
    return $use;
}
function directory_theme_entry_meta()
{
    if (is_sticky() && is_home() && !is_paged()) {
        printf('<span class="sticky-post">%s</span>', __('Featured', 'directory-starter'));
    }
    $format = get_post_format();
    if (current_theme_supports('post-formats', $format)) {
        printf('<span class="entry-format">%1$s<a href="%2$s">%3$s</a></span>', sprintf('<span class="screen-reader-text">%s </span>', _x('Format', 'Used before post format.', 'directory-starter')), esc_url(get_post_format_link($format)), get_post_format_string($format));
    }
    if (in_array(get_post_type(), array('post', 'attachment'))) {
        $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
        $time_string = sprintf($time_string, esc_attr(get_the_date('c')), get_the_date(), esc_attr(get_the_modified_date('c')), get_the_modified_date());
        printf('<span class="posted-on"><span class="screen-reader-text">%1$s </span><a href="%2$s" rel="bookmark">%3$s</a></span>', _x('Posted on', 'Used before publish date.', 'directory-starter'), esc_url(get_permalink()), $time_string);
    }
    if ('post' == get_post_type()) {
        if (is_singular() || is_multi_author()) {
            printf('<span class="byline"><span class="author vcard"><span class="screen-reader-text">%1$s </span><a class="url fn n" href="%2$s">%3$s</a></span></span>', _x('Author', 'Used before post author name.', 'directory-starter'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_the_author());
        }
        $categories_list = get_the_category_list(_x(', ', 'Used between list items, there is a space after the comma.', 'directory-starter'));
        if ($categories_list) {
            printf('<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Categories', 'Used before category names.', 'directory-starter'), $categories_list);
        }
        $tags_list = get_the_tag_list('', _x(', ', 'Used between list items, there is a space after the comma.', 'directory-starter'));
        if ($tags_list) {
            printf('<span class="tags-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', _x('Tags', 'Used before tag names.', 'directory-starter'), $tags_list);
        }
    }
    if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
        echo '<span class="comments-link">';
        comments_popup_link(__('Leave a comment', 'directory-starter'), __('1 Comment', 'directory-starter'), __('% Comments', 'directory-starter'));
        echo '</span>';
    }
}
Example #13
0
function k2_asides_permalink($content)
{
    if (in_category(get_option('unwakeable_asidescategory')) and !is_singular()) {
        $content .= '<a href="' . get_permalink() . '" rel="bookmark" class="asides-permalink" title="' . k2_permalink_title(false) . '">(' . get_comments_number() . ')</a>';
    }
    return $content;
}
Example #14
0
 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function sangeet_entry_footer()
 {
     // Hide category and tag text for pages.
     if ('post' === get_post_type()) {
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', 'sangeet'));
         if ($categories_list && sangeet_categorized_blog()) {
             printf('<span class="cat-links">' . esc_html__('%1$s', 'sangeet') . '</span>', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', 'sangeet'));
         if ($tags_list) {
             printf('<span class="tags-links">' . esc_html__('%1$s', 'sangeet') . '</span>', $tags_list);
             // WPCS: XSS OK.
         }
     }
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link">';
         comments_popup_link(esc_html__('Leave a comment', 'sangeet'), esc_html__('1 Comment', 'sangeet'), esc_html__('% Comments', 'sangeet'));
         echo '</span>';
     }
     edit_post_link(sprintf(esc_html__('Edit %s', 'sangeet'), the_title('<span class="screen-reader-text">"', '"</span>', false)), '<span class="edit-link">', '</span>');
     if (!is_single()) {
         echo '<span class="continue-reading"><a href="' . get_permalink() . '" title="' . esc_html__('Continue Reading ', 'sangeet') . get_the_title() . '" rel="bookmark">' . esc_html__('Continue Reading ', 'sangeet') . '</a></span>';
     }
 }
 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function chroma_entry_footer()
 {
     // Hide category and tag text for pages.
     echo '<footer class="entry-footer">';
     if ('post' === get_post_type()) {
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', 'chroma'));
         if ($categories_list && chroma_categorized_blog()) {
             printf('<span class="cat-links"><i title="Categories..." class="fa fa-archive"></i>' . esc_html__(' %1$s', 'chroma') . '</span> ', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', 'chroma'));
         if ($tags_list) {
             printf('<span class="tags-links"><i title="Tags..." class="fa fa-hashtag"></i>' . esc_html__(' %1$s', 'chroma') . '</span> ', $tags_list);
             // WPCS: XSS OK.
         }
     }
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link"><i title="Comments..." class="fa fa-commenting"></i> ';
         comments_popup_link(esc_html__('Comment', 'chroma'), esc_html__('1 Comment', 'chroma'), esc_html__('% Comments', 'chroma'));
         echo '</span>';
     }
     /*	edit_post_link(
     		sprintf(
     			esc_html__( 'Edit %s', 'chroma' ),
     			the_title( '<span class="screen-reader-text">"', '"</span>', false )
     		),
     		'<span class="edit-link">',
     		'</span>'
     	);
     */
     echo '</footer><!-- .entry-footer -->';
 }
Example #16
0
function add_shortcode_blog($atts)
{
    extract(shortcode_atts(array('categories' => '', 'count' => 4), $atts));
    $output = '';
    $output .= '<div class="blog-post-shortcode">';
    $i = 0;
    $args = array("post_type" => "post", "posts_per_page" => $count, "cat" => $categories);
    query_posts($args);
    while (have_posts()) {
        the_post();
        $output .= '<div class="post-home three columns">';
        $output .= '<div class="post-format-wrap">';
        $output .= tf_get_post_format(array('image' => array('width' => 420, 'height' => 290), 'gallery' => array('width' => 420, 'height' => 290), 'video' => array('width' => 420, 'height' => 290)));
        $output .= '</div>';
        $output .= '<h4><a href="' . get_permalink() . '">' . get_the_title() . '</a></h4>';
        $output .= '<div>' . get_the_date('d M, Y') . ' &nbsp;-&nbsp; ' . get_comments_number() . ' ' . __('comments', THEME_SLUG) . '</div>';
        $output .= '<p>' . tf_the_excerpt_max_charlength(120) . '</p>';
        $output .= '</div>';
    }
    wp_reset_query();
    wp_reset_postdata();
    $output .= '</div>';
    $output .= '<div class="clear"></div>';
    return $output;
}
 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function moderna_tag_comment()
 {
     // Hide category and tag text for pages.
     if ('post' === get_post_type()) {
         /* translators: used between list items, there is a space after the comma */
         /*            $categories_list = get_the_category_list(esc_html__(', ', 'moderna'));
                       if ($categories_list && moderna_categorized_blog()) {
                           printf('<span class="cat-links">' . esc_html__('Posted in %1$s', 'moderna') . '</span>', $categories_list); // WPCS: XSS OK.
                       }*/
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', '<div style="float: left;">,&nbsp;</div>');
         printf('<li><i class="icon-folder-open"></i>' . esc_html__('%1$s', 'moderna') . '</li>', $tags_list);
         // WPCS: XSS OK.
     }
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<li><i class="icon-comments"></i>';
         comments_popup_link(esc_html__('No comments', 'moderna'), esc_html__('1 Comment', 'moderna'), esc_html__('% Comments', 'moderna'));
         echo '</li>';
     }
     /*
                          edit_post_link(
                              sprintf(
                              // translators: %s: Name of current post
                                  esc_html__('Edit %s', 'moderna'),
                                  the_title('<span class="screen-reader-text">"', '"</span>', false)
                              ),
                              '<span class="edit-link">',
                              '</span>'
                          );*/
 }
 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function tm_vals_blog_posted_on()
 {
     $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
     if (get_the_time('U') !== get_the_modified_time('U')) {
         $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
     }
     $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
     // comments in header
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link">';
         comments_popup_link(esc_html__('Leave a comment', 'tm-vals-blog'), esc_html__('1', 'tm-vals-blog'), esc_html__('%', 'tm-vals-blog'));
         echo '</span>';
     }
     /*	$posted_on = sprintf(
     		esc_html_x( 'Posted on %s', 'post date', 'tm-vals-blog' ),
     		'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
     	);
     
     	$byline = sprintf(
     		esc_html_x( 'by %s', 'post author', 'tm-vals-blog' ),
     		'<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
     	);
     
     	echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>'; // WPCS: XSS OK.
     */
 }
Example #19
0
 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function amnesty_entry_footer()
 {
     // Hide category and tag text for pages.
     if ('post' === get_post_type()) {
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__('', 'amnesty'));
         if ($categories_list && amnesty_categorized_blog()) {
             printf('<span class="cat-links"><h2>' . esc_html__('Posted in', 'amnesty') . '</h2>%1$s</span>', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('<li>', '</li><li>', '</li>');
         if ($tags_list) {
             printf('<span class="tags-links"><h2>' . esc_html__('Tagged', 'amnesty') . '</h2><ul>%1$s</ul></span>', $tags_list);
             // WPCS: XSS OK.
         }
     }
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link">';
         comments_popup_link(esc_html__('Leave a comment', 'amnesty'), esc_html__('1 Comment', 'amnesty'), esc_html__('% Comments', 'amnesty'));
         echo '</span>';
     }
     //    edit_post_link(
     //        sprintf(
     //        /* translators: %s: Name of current post */
     //            esc_html__('Edit %s', 'amnesty'),
     //            the_title('<span class="screen-reader-text">"', '"</span>', false)
     //        ),
     //        '<span class="edit-link">',
     //        '</span>'
     //    );
 }
/**
 * This is a duplicate of the above. Probably delete others
 */
function kanec_entry_meta()
{
    // Time
    $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
    if (get_the_time('U') !== get_the_modified_time('U')) {
        $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
    }
    $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
    echo '<div class="posted-on"><i class="icon icon-calendar-o"></i><a href="' . esc_url(get_permalink()) . '" rel="bookmark">' . $time_string . '</a></div>';
    // Author
    echo '<div class="byline"><i class="icon icon-user"></i><span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span></div>';
    // Categories & Tags
    // Hide category and tag text for pages.
    if ('post' === get_post_type()) {
        /* translators: used between list items, there is a space after the comma */
        $categories_list = get_the_category_list(esc_html__(', ', 'kanec'));
        if ($categories_list && kanec_categorized_blog()) {
            echo '<div class="cat-links"><i class="icon icon-folder-open"></i>' . $categories_list . '</div>';
        }
        /* translators: used between list items, there is a space after the comma */
        $tags_list = get_the_tag_list('', esc_html__(', ', 'kanec'));
        if ($tags_list) {
            echo '<div class="tags-links"><i class="icon icon-tags"></i>' . $tags_list . '</div>';
        }
    }
    if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
        echo '<div class="comments-link"><i class="icon icon-comments"></i>';
        comments_popup_link(esc_html__('Leave a comment', 'kanec'), esc_html__('1 Comment', 'kanec'), esc_html__('% Comments', 'kanec'));
        echo '</div>';
    }
}
Example #21
0
 function widget($args, $instance)
 {
     global $post;
     /* PRINT THE WIDGET */
     extract($args, EXTR_SKIP);
     $title = !empty($instance['title']) ? $instance['title'] : '';
     if (!is_single()) {
         return;
     }
     echo $before_widget;
     if (!empty($title)) {
         echo $before_title;
         echo $title;
         echo $after_title;
     }
     $name = get_the_author_meta('display_name', $post->post_author);
     echo '<div class="large-icons">';
     echo '<ul>';
     edit_post_link('<i class="icon-pencil"></i>' . __('Edit', 'myThemes'), '<li>', '</li>');
     echo '<li><a href="' . get_day_link(get_post_time('Y', false, $post->ID), get_post_time('m', false, $post->ID), get_post_time('d', false, $post->ID)) . '">';
     echo '<time datetime="' . get_post_time('Y-m-d', false, $post->ID) . '"><i class="icon-calendar"></i>' . get_post_time(get_option('date_format'), false, $post->ID) . '</time></a></li>';
     echo '<li><a href="' . get_author_posts_url($post->post_author) . '" title="' . __('Writed by ', 'myThemes') . ' ' . $name . '"><i class="icon-user-5"></i>' . $name . '</a></li>';
     if ($post->comment_status == 'open') {
         $nr = get_comments_number($post->ID);
         if ($nr == 1) {
             $comments = $nr . ' ' . __('Comment', 'myThemes');
         } else {
             $comments = $nr . ' ' . __('Comments', 'myThemes');
         }
         echo '<li><a href="' . get_comments_link($post->ID) . '"><i class="icon-comment"></i>' . $comments . '</a></li>';
     }
     echo '</ul>';
     echo '</div>';
     echo $after_widget;
 }
Example #22
0
function adm_sitemap_posts($atts)
{
    extract(shortcode_atts(array('comments_number' => true, 'number' => '0', 'cat' => '', 'posts' => '', 'author' => '', 'type' => 'post', 'comments' => 'true'), $atts));
    if ($number == 0) {
        $number = 1000;
    }
    if ($comments_number === 'false') {
        $comments_number = false;
    }
    $query = array('showposts' => (int) $number, 'post_type' => $type);
    if ($cat) {
        $query['cat'] = $cat;
    }
    if ($posts) {
        $query['post__in'] = explode(',', $posts);
    }
    if ($author) {
        $query['author'] = $author;
    }
    $archive_query = new WP_Query($query);
    $output = '';
    while ($archive_query->have_posts()) {
        $archive_query->the_post();
        $output .= '<li><a href="' . get_permalink() . '" rel="bookmark" title="' . sprintf(__("Permanent Link to %s", 'striking_front'), get_the_title()) . '">' . get_the_title() . '</a>';
        if ($comments == 'true') {
            $output .= $comments_number ? ' (' . get_comments_number() . ')' : '';
        }
        $output .= '</li>';
    }
    wp_reset_query();
    return '<div class="sc-sitemap sitemap-posts"><ul>' . $output . '</ul></div>';
}
 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function ving_entry_footer()
 {
     global $wp_query;
     // Hide category and tag text for pages.
     if ('post' === get_post_type()) {
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', 'ving'));
         if ($categories_list && ving_categorized_blog()) {
             $post = $wp_query->post;
             $cat = wp_get_post_terms($post->ID, 'category');
             $count = count($cat);
             if ($count > 1) {
                 printf('<span class="cat-links col-lg-6 col-md-6 col-sm-6 col-xs-12"><span class="text">CATEGORIES</span>' . esc_html__('%1$s', 'ving') . '</span>', $categories_list);
                 // WPCS: XSS OK.
             } else {
                 printf('<span class="cat-links col-lg-6 col-md-6 col-sm-6 col-xs-12"><span class="text">CATEGORY</span>' . esc_html__('%1$s', 'ving') . '</span>', $categories_list);
                 // WPCS: XSS OK.
             }
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', 'ving'));
         if ($tags_list) {
             printf('<span class="tags-links col-lg-5 col-md-5 col-sm-5 col-xs-12"><span class="text">TAGS</span>' . esc_html__('%1$s', 'ving') . '</span>', $tags_list);
             // WPCS: XSS OK.
         }
     }
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link">';
         comments_popup_link(esc_html__('Leave a comment', 'ving'), esc_html__('1 Comment', 'ving'), esc_html__('% Comments', 'ving'));
         echo '</span>';
     }
     edit_post_link(sprintf(esc_html__('Edit %s', 'ving'), the_title('<span class="screen-reader-text">"', '"</span>', false)), '<span class="edit-link">', '</span>');
 }
Example #24
0
 /**
  * Prints HTML with meta information for current post: categories, tags, permalink, author, and date.
  *
  * @return void
  */
 function wheels_entry_meta()
 {
     if (is_sticky() && is_home() && !is_paged()) {
         echo '<span class="featured-post">' . __('Sticky', 'wheels') . '</span>';
     }
     if (!has_post_format('link') && 'post' == get_post_type()) {
         wheels_entry_date();
     }
     // Translators: used between list items, there is a space after the comma.
     $categories_list = get_the_category_list(__(', ', 'wheels'));
     if ($categories_list) {
         echo '/<span class="categories-links">' . $categories_list . '</span>';
     }
     // Translators: used between list items, there is a space after the comma.
     $tag_list = get_the_tag_list('', __(', ', 'wheels'));
     if ($tag_list) {
         echo '/<span class="tags-links">' . $tag_list . '</span>';
     }
     // Post author
     if ('post' == get_post_type()) {
         printf('/<span class="author vcard">%1$s <a class="url fn n" href="%2$s" title="%3$s" rel="author">%4$s</a></span>', __('by', 'wheels'), esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'wheels'), get_the_author())), get_the_author());
         $num_comments = get_comments_number();
         // get_comments_number returns only a numeric value
         if ($num_comments == 0) {
         } else {
             if ($num_comments > 1) {
                 $comments = $num_comments . __(' Comments', 'wheels');
             } else {
                 $comments = __('1 Comment', 'wheels');
             }
             echo $write_comments = '/<span class="comments-count"><a href="' . get_comments_link() . '">' . $comments . '</a></span>';
         }
     }
 }
Example #25
0
 /**
  * Prints HTML with meta information for the current post-date/time and author.
  */
 function ocin_lite_metadata()
 {
     echo '<ul>';
     $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
     if (get_the_time('U') !== get_the_modified_time('U')) {
         $time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
     }
     $time_string = sprintf($time_string, esc_attr(get_the_date('c')), esc_html(get_the_date()), esc_attr(get_the_modified_date('c')), esc_html(get_the_modified_date()));
     echo '<li class="meta_date">' . $time_string . '</li>';
     $byline = sprintf(esc_html_x('by %s', 'post author', 'ocin-lite'), '<span class="author vcard"><a class="url fn n" href="' . esc_url(get_author_posts_url(get_the_author_meta('ID'))) . '">' . esc_html(get_the_author()) . '</a></span>');
     echo '<li class="meta_comments">' . $byline . '</li>';
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<li class="meta_date"><span class="comments-link">';
         comments_popup_link(esc_html__('Leave a comment', 'ocin-lite'), esc_html__('1 Comment', 'ocin-lite'), esc_html__('% Comments', 'ocin-lite'));
         echo '</span></li>';
     }
     // Hide category and tag text for pages.
     if ('post' === get_post_type() && is_single()) {
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', 'ocin-lite'));
         if ($categories_list && ocin_lite_categorized_blog()) {
             printf('<li class="meta_categories"><span class="cat-links">' . esc_html__('Posted in %1$s', 'ocin-lite') . '</span></li>', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', 'ocin-lite'));
         if ($tags_list) {
             printf('<li class="meta_tags"><span class="tags-links">' . esc_html__('Tagged %1$s', 'ocin-lite') . '</span></li>', $tags_list);
             // WPCS: XSS OK.
         }
     }
     echo '</ul>';
 }
Example #26
0
function comments()
{
    // If comments are open or we have at least one comment, load up the comment template.
    if (comments_open() || get_comments_number()) {
        comments_template();
    }
}
Example #27
0
function blog_summary_shortcode($attr)
{
    // Describes what attributes to parse from shortcode; only 'count'
    extract(shortcode_atts(array('count' => '5', 'grouptag' => 'ul', 'entrytag' => 'li', 'titletag' => 'h4', 'datetag' => 'span', 'commentstag' => 'span', 'summarytag' => 'div'), $attr));
    // Queries to populate our loop based on shortcode count attribute
    $r = new WP_Query("showposts={$count}&what_to_show=posts&nopaging=0&post_status=publish");
    // Only run if we have posts; can't run this through searches
    if ($r->have_posts() && !is_search()) {
        // If we're using a Sandbox-friendly theme . . .
        if (function_exists('sandbox_body_class')) {
            // We can't have double hfeed classes, otherwise it won't parse
            $groupclasses = 'xoxo';
        } else {
            // Otherwise, use hfeed to ensure hAtom compliance
            $groupclasses = 'xoxo hfeed';
        }
        // Begin the output for shortcode and inserts in the group tag what classes we have
        $output = '<' . $grouptag . ' class="' . $groupclasses . '">';
        // Begins our loop for returning posts
        while ($r->have_posts()) {
            // Sets which post from our loop we're at
            $r->the_post();
            // Allows the_date() with multiple posts within a single day
            unset($previousday);
            // If we're using a Sandbox-friendly theme . . .
            if (function_exists('sandbox_post_class')) {
                // Let's use semantic classes with each entry element
                $entryclasses = sandbox_post_class(false);
            } else {
                // Otherwise, use hentry to ensure hAtom compliance
                $entryclasses = 'hentry';
            }
            // Begin entry wrapper and inserts what classes we got from above
            $output .= "\n" . '<' . $entrytag . ' class="' . $entryclasses . '">';
            // Post title
            $output .= "\n" . '<' . $titletag . ' class="entry-title"><a href="' . get_permalink() . '" title="' . sprintf(__('Permalink to %s', 'blog_summary'), the_title_attribute('echo=0')) . '" rel="bookmark">' . get_the_title() . '</a></' . $titletag . '>';
            // Post date with hAtom support
            $output .= "\n" . '<' . $datetag . ' class="entry-date"><abbr class="published" title="' . get_the_time('Y-m-d\\TH:i:sO') . '">' . sprintf(__('%s', 'blog_summary'), the_date('', '', '', false)) . '</abbr></' . $datetag . '>';
            // Comments number
            $output .= "\n" . '<' . $commentstag . ' class="entry-comments"><a href="' . get_permalink() . '#comments" title="' . sprintf(__('Comments to %s', 'blog_summary'), the_title_attribute('echo=0')) . '">' . sprintf(__('Comments (%s)', 'blog_summary'), apply_filters('comments_number', get_comments_number())) . '</a></' . $commentstag . '>';
            // Post excerpt with hAtom support
            $output .= "\n" . '<' . $summarytag . ' class="entry-summary">' . "\n" . apply_filters('the_excerpt', get_the_excerpt()) . '</' . $summarytag . '>';
            // Close each post LI
            $output .= "\n" . '</' . $entrytag . '>';
            // Finish the have_posts() query
        }
        // while ( $r->have_posts() ) :
        // Close the parent UL
        $output .= "\n" . '</' . $grouptag . '>';
        // Rewinds loop from $r->the_post();
        rewind_posts();
        // End the initial IF statement
    }
    // if ( $r->have_posts() ) :
    // Clears our query to put the loop back where it was
    wp_reset_query();
    // $r = new WP_Query()
    // Returns $output to the shortcode
    return $output;
}
Example #28
0
function bpe_feature()
{
    ?>
<div class="featuredpost">
<h2>Featured Post</h2>

<a href="http://website-in-a-weekend.net/building-traffic/publish-blog-post/#comments/">
<?php 
    echo get_comments_number(16545);
    ?>
 comments, add yours!
</a>
</div>

<div class="featuredheadline">
<h2><a href="http://website-in-a-weekend.net/building-traffic/publish-blog-post/">
How to publish the **** out of your blog post</a></h2>

<p>You know, writing a blog post is about half the work... 
or did you know that?</p>

<p>Getting it <em>published</em> is a whole 'nother ball game.</p>

<p>Fortunately, you now have a resource that lays it all out, 
step-by-step guidelines for helping you get your blog post 
out there in front of everyone... including Google.</p>

<p><a href="http://website-in-a-weekend.net/building-traffic/publish-blog-post/">Read How to publish the **** out of your blog post...</a></p>
</div>
<?php 
}
Example #29
0
function ts_recentposts($atts, $content = null)
{
    extract(shortcode_atts(array("title" => '', "cat" => '', "longchar" => 130), $atts));
    $content = ts_remove_autop($content);
    $output = '';
    if ($title != "") {
        $output .= '<h2 class="title_pattern uppercase"><span>' . $title . '</span></h2>';
    }
    $i = 1;
    query_posts("showposts=4&category_name=" . $cat);
    global $post;
    $output .= '<ul id="recentpost">';
    while (have_posts()) {
        the_post();
        if ($i % 4 == 0) {
            $addclass = "last";
        } else {
            $addclass = "";
        }
        $excerpt = get_the_excerpt();
        //get_comment
        $num_comments = get_comments_number();
        // for some reason get_comments_number only returns a numeric value displaying the number of comments
        if (comments_open()) {
            if ($num_comments == 0) {
                $comments = __('No Comments', 'templatesquare');
            } elseif ($num_comments > 1) {
                $comments = $num_comments . __(' Comments', 'templatesquare');
            } else {
                $comments = "1 Comment";
            }
            $write_comments = '<a href="' . get_comments_link() . '">' . $comments . '</a>';
        } else {
            $write_comments = __('Comments off', 'templatesquare');
        }
        //get blog post thumb
        $custom = get_post_custom($post->ID);
        $cf_thumb = isset($custom["thumb"][0]) ? $custom["thumb"][0] : "";
        if ($cf_thumb != "") {
            $thumb = '<img src=' . $cf_thumb . ' alt="" width="210" height="158" class="frame"/><span class="shadowimg220"></span>';
        } elseif (has_post_thumbnail($post->ID)) {
            $thumb = get_the_post_thumbnail($post->ID, 'blog-post-thumb', array('alt' => '', 'class' => 'frame')) . '<span class="shadowimg220"></span>';
        } else {
            $thumb = "";
        }
        $output .= '<li class="' . $addclass . '">';
        $output .= $thumb;
        $output .= '<div class="entry-date">' . get_the_time('d/m/y') . ' - ' . $write_comments . '</div>';
        $output .= '<h5 class="colortext"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h5>';
        $output .= '<span>' . ts_string_limit_char($excerpt, $longchar) . '</span>';
        $output .= '</li>';
        $i++;
        $addclass = "";
    }
    wp_reset_query();
    $output .= '</ul>';
    $output .= '<div class="clear"></div>';
    return do_shortcode($output);
}
Example #30
-1
 /**
  * Prints HTML with meta information for the categories, tags and comments.
  */
 function xmaps_entry_footer()
 {
     // Hide category and tag text for pages.
     if ('post' === get_post_type()) {
         /* translators: used between list items, there is a space after the comma */
         $categories_list = get_the_category_list(esc_html__(', ', 'xmaps'));
         if ($categories_list && xmaps_categorized_blog()) {
             printf('<span class="cat-links">' . esc_html__('Posted in %1$s', 'xmaps') . '</span>', $categories_list);
             // WPCS: XSS OK.
         }
         /* translators: used between list items, there is a space after the comma */
         $tags_list = get_the_tag_list('', esc_html__(', ', 'xmaps'));
         if ($tags_list) {
             printf('<span class="tags-links">' . esc_html__('Tagged %1$s', 'xmaps') . '</span>', $tags_list);
             // WPCS: XSS OK.
         }
     }
     if (!is_single() && !post_password_required() && (comments_open() || get_comments_number())) {
         echo '<span class="comments-link">';
         /* translators: %s: post title */
         comments_popup_link(sprintf(wp_kses(__('Leave a Comment<span class="screen-reader-text"> on %s</span>', 'xmaps'), array('span' => array('class' => array()))), get_the_title()));
         echo '</span>';
     }
     edit_post_link(sprintf(esc_html__('Edit %s', 'xmaps'), the_title('<span class="screen-reader-text">"', '"</span>', false)), '<span class="edit-link">', '</span>');
 }