function widget($args, $instance)
    {
        extract($args);
        global $wp_query;
        /* Our variables from the widget settings. */
        $title = apply_filters('widget_title', $instance['title']);
        $number = $instance['number'];
        $category = $instance['category'];
        /* Before widget (defined by themes). */
        echo $before_widget;
        /* Display the widget title if one was input (before and after defined by themes). */
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        if (!$number) {
            $number = -1;
        }
        $blog_posts = new WP_Query(array('post_type' => 'post', 'posts_per_page' => $number, 'category__in' => $category, 'orderby' => 'comment_count', 'order' => 'DESC', 'ignore_sticky_posts' => true));
        if ($blog_posts->have_posts()) {
            ?>
		<ul class="most-liked-list most-commented">
			<?php 
            while ($blog_posts->have_posts()) {
                $blog_posts->the_post();
                $comments_count = wp_count_comments(get_the_ID());
                $comments_approved = $comments_count->approved;
                $post_author = get_the_author_link();
                $post_date = get_the_date();
                ?>
				<li>
					<a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a>
					<span><?php 
                printf(__('By %1$s on %2$s', 'hbthemes'), $post_author, $post_date);
                ?>
</span>
					<span class="like-count"><i class="hb-moon-bubbles-7"></i></span>
					<a href="<?php 
                the_permalink();
                ?>
" class="like-count-num"><?php 
                echo number_format($comments_approved);
                ?>
</a>
				</li>
			<?php 
            }
            ?>
		</ul>
		<?php 
        }
        echo $after_widget;
    }
Example #2
0
    function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        $instance = wp_parse_args($instance, array('title' => __('Latest Questions', 'dwqa'), 'number' => 5));
        echo $before_widget;
        echo $before_title;
        echo $instance['title'];
        echo $after_title;
        $args = array('posts_per_page' => $instance['number'], 'order' => 'DESC', 'orderby' => 'post_date', 'post_type' => 'dwqa-question', 'suppress_filters' => false);
        $questions = new WP_Query($args);
        if ($questions->have_posts()) {
            echo '<div class="dwqa-popular-questions">';
            echo '<ul>';
            while ($questions->have_posts()) {
                $questions->the_post();
                echo '
				<li><a href="' . get_permalink() . '" class="question-title">' . get_the_title() . '</a> ' . __('asked by', 'dwqa') . ' ' . (dwqa_is_anonymous(get_the_ID()) ? __('Anonymous', 'dwqa') : get_the_author_link()) . ', ' . human_time_diff(get_the_time('U'), current_time('timestamp')) . ' ago';
                '</li>';
            }
            echo '</ul>';
            echo '</div>';
        }
        wp_reset_query();
        wp_reset_postdata();
        echo $after_widget;
    }
Example #3
0
 public function shortcode_popular_questions($atts)
 {
     extract(shortcode_atts(array('number' => 5, 'title' => __('Popular Questions', 'dwqa')), $atts));
     $args = array('posts_per_page' => $number, 'order' => 'DESC', 'orderby' => 'meta_value_num', 'meta_key' => '_dwqa_views', 'post_type' => 'dwqa-question', 'suppress_filters' => false);
     $questions = new WP_Query($args);
     $html = '';
     if ($title) {
         $html .= '<h3>';
         $html .= $title;
         $html .= '</h3>';
     }
     if ($questions->have_posts()) {
         $html .= '<div class="dwqa-popular-questions">';
         $html .= '<ul>';
         while ($questions->have_posts()) {
             $questions->the_post();
             $html .= '<li><a href="' . get_permalink() . '" class="question-title">' . get_the_title() . '</a> ' . __('asked by', 'dwqa') . ' ' . get_the_author_link() . '</li>';
         }
         $html .= '</ul>';
         $html .= '</div>';
     }
     wp_reset_query();
     wp_reset_postdata();
     return $html;
 }
    function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        $instance = wp_parse_args($instance, array('title' => __('Closed Questions', 'dwqa'), 'number' => 5));
        echo $before_widget;
        echo $before_title;
        echo $instance['title'];
        echo $after_title;
        $args = array('post_type' => 'dwqa-question', 'meta_query' => array('relation' => 'OR', array('key' => '_dwqa_status', 'compare' => '=', 'value' => 'resolved'), array('key' => '_dwqa_status', 'compare' => '=', 'value' => 'closed')));
        $questions = new WP_Query($args);
        if ($questions->have_posts()) {
            echo '<div class="dwqa-popular-questions">';
            echo '<ul>';
            while ($questions->have_posts()) {
                $questions->the_post();
                echo '
				<li><a href="' . get_permalink() . '" class="question-title">' . get_the_title() . '</a> ' . __('asked by', 'dwqa') . ' ' . get_the_author_link();
                '</li>';
            }
            echo '</ul>';
            echo '</div>';
        }
        wp_reset_query();
        wp_reset_postdata();
        echo $after_widget;
    }
Example #5
0
/**
 * Displays meta information for a post
 * @return void
 */
function appletree_post_meta()
{
    if (get_post_type() == 'post') {
        echo sprintf(__('Posted %s in %s%s by %s. ', 'appletreesg.com'), get_the_time(get_option('date_format')), get_the_category_list(', '), get_the_tag_list(__(', <b>Tags</b>: ', 'appletreesg.com'), ', '), get_the_author_link());
    }
    edit_post_link(__(' (edit)', 'appletreesg.com'), '<span class="edit-link">', '</span>');
}
Example #6
0
function theme_latest_news($atts, $content)
{
    global $themename;
    extract(shortcode_atts(array("count" => 2, "category" => "", "order" => "DESC"), $atts));
    query_posts(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $count, 'cat' => $category, 'order' => $order));
    $output = '<ul class="blog clearfix">';
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            $post_classes = get_post_class("post");
            $output .= '<li class="';
            foreach ($post_classes as $key => $post_class) {
                $output .= $post_class . ($key + 1 < count($post_classes) ? ' ' : '');
            }
            $output .= '">
						<div class="comment_box">
							<div class="first_row">
								' . get_the_time("d") . '<span class="second_row">' . strtoupper(get_the_time("M")) . '</span>
							</div>';
            $comments_count = get_comments_number();
            $output .= '		<a class="comments_number" href="' . get_comments_link() . '" title="' . $comments_count . ($comments_count == 1 ? ' ' . __('Comment', $themename) : ' ' . __('Comments', $themename)) . '">' . $comments_count . ($comments_count == 1 ? ' ' . __('Comment', $themename) : ' ' . __('Comments', $themename)) . '</a>
						</div>
						<div class="post_content">';
            if (has_post_thumbnail()) {
                $output .= '<a class="post_image" href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_post_thumbnail(get_the_ID(), "blog-post-thumb", array("alt" => get_the_title(), "title" => "")) . '</a>';
            }
            $output .= '		<h2>
								<a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_title() . '</a>
							</h2>
							<div class="text">
								' . apply_filters('the_excerpt', get_the_excerpt()) . '
							</div>
							<div class="post_footer">
								<ul class="categories">
									<li class="posted_by">' . __('Posted by', $themename) . ' <a class="author" href="' . get_the_author_link() . '" title="' . get_the_author() . '">' . get_the_author() . '</a></li>';
            $categories = get_the_category();
            foreach ($categories as $key => $category) {
                $output .= '<li>
											<a href="' . get_category_link($category->term_id) . '" ';
                if (empty($category->description)) {
                    $output .= 'title="' . sprintf(__('View all posts filed under %s', $themename), $category->name) . '"';
                } else {
                    $output .= 'title="' . esc_attr(strip_tags(apply_filters('category_description', $category->description, $category))) . '"';
                }
                $output .= '>' . $category->name . '</a>
										</li>';
            }
            $output .= '			</ul>
								<a class="more icon_small_arrow margin_right_white" href="' . get_permalink() . '" title="' . __("More", $themename) . '">' . __("More", $themename) . '</a>
							</div>
						</div>
					</li>';
        }
    }
    $output .= '</ul>';
    //Reset Query
    wp_reset_query();
    return $output;
}
Example #7
0
function uppsite_get_member()
{
    $avatar = null;
    if (function_exists('get_the_author_meta')) {
        $avatar = get_avatar(get_the_author_meta('user_email'));
    } elseif (function_exists('get_the_author_id')) {
        $avatar = get_avatar(get_the_author_id());
    }
    return array('name' => get_the_author(), 'link' => get_the_author_link(), 'avatar' => uppsite_extract_src_url($avatar));
}
    public function hook_after_post_content($content)
    {
        if (is_single()) {
            $content .= '
				<div class="focuswarp">
				<div class="focusavatar">
					' . get_avatar(get_the_author_email(), '80') . '
				</div>
				<div class="focustext">
					<h4>Author: <span>' . get_the_author_link('display_name', get_query_var('author')) . '</span></h4>' . get_the_author_meta('description', get_query_var('author')) . '
				</div>';
            $content .= '
				<div class="focus-social">
				';
            if (get_the_author_meta('twitter', get_query_var('author'))) {
                $content .= '<a href="' . esc_url(get_the_author_meta('twitter')) . '" target="_blank"><i class="fa fa-twitter fa-lg"></i> Twitter</a> ';
            }
            if (get_the_author_meta('facebook', get_query_var('author'))) {
                $content .= '<a href="' . esc_url(get_the_author_meta('facebook')) . '" target="_blank"><i class="fa fa-facebook fa-lg"></i> Facebook</a> ';
            }
            if (get_the_author_meta('gplus', get_query_var('author'))) {
                $content .= '<a href="' . esc_url(get_the_author_meta('gplus')) . '" target="_blank"><i class="fa fa-google-plus fa-lg"></i> Google+</a> ';
            }
            if (get_the_author_meta('linkedin', get_query_var('author'))) {
                $content .= '<a href="' . esc_url(get_the_author_meta('linkedin')) . '" target="_blank"><i class="fa fa-linkedin fa-lg"></i> Linkedin</a> ';
            }
            if (get_the_author_meta('dribbble', get_query_var('author'))) {
                $content .= '<a href="' . esc_url(get_the_author_meta('dribbble')) . '" target="_blank"><i class="fa fa-dribbble fa-lg"></i> Dribbble</a> ';
            }
            if (get_the_author_meta('github', get_query_var('author'))) {
                $content .= '<a href="' . esc_url(get_the_author_meta('github')) . '" target="_blank"><i class="fa fa-github fa-lg"></i> Github</a>';
            }
            if (get_the_author_meta('youtube', get_query_var('author'))) {
                $content .= '<a href="' . esc_url(get_the_author_meta('youtube')) . '" target="_blank"><i class="fa fa-youtube fa-lg"></i> Youtube</a>';
            }
            if (get_the_author_meta('pinterest', get_query_var('author'))) {
                $content .= '<a href="' . esc_url(get_the_author_meta('pinterest')) . '" target="_blank"><i class="fa fa-pinterest-square fa-lg"></i> Pinterest</a>';
            }
            if (get_the_author_meta('instagram', get_query_var('author'))) {
                $content .= '<a href="' . esc_url(get_the_author_meta('instagram')) . '" target="_blank"><i class="fa fa-instagram fa-lg"></i> Instagram</a>';
            }
            if (get_the_author_meta('vimeo', get_query_var('author'))) {
                $content .= '<a href="' . esc_url(get_the_author_meta('vimeo')) . '" target="_blank"><i class="fa fa-vimeo-square fa-lg"></i> vimeo</a>';
            }
            if (get_the_author_meta('skype', get_query_var('author'))) {
                $content .= '<a href="' . esc_url(get_the_author_meta('skype')) . '" target="_blank"><i class="fa fa-skype fa-lg"></i> Skype</a>';
            }
            $content .= '
				</div>
				</div>';
        }
        return $content;
    }
Example #9
0
 public static function createPageObject($getComments = false, $postObject = null)
 {
     global $post;
     if ($postObject != null) {
         setup_postdata($postObject);
     }
     $params = array('pageLink' => get_page_link(), 'post_title' => get_the_title(), 'time' => get_the_time(), 'post_content' => apply_filters('the_content', get_the_content()), 'post_excerpt' => get_the_excerpt(), 'post_author' => get_the_author(), 'author_link' => get_the_author_link(), 'thumbnails' => self::getThumbnails($post), 'pageUri' => get_page_uri($post), 'comments' => '');
     if ($getComments != false) {
         $params['comments'] = self::getComments($post->ID);
     }
     $post_object_var = get_object_vars($post);
     $post_params = $params + $post_object_var;
     return new Page($post_params);
 }
/**
 * Prints HTML with header, title and meta information for the current post.
 * 
 */
function lady_B_post_header($showDate = true)
{
    $mh2 = sprintf('<h2><a href="%s">%s</a></h2>', esc_url(get_the_permalink()), esc_attr(get_the_title()));
    $mauthor = sprintf('<span class="posted">By %s</span>', get_the_author_link());
    $mdate = "";
    if ($showDate) {
        $mdate = sprintf('<span class="date"><a href="%s">%s</a></span>', esc_url(get_the_permalink()), esc_html(get_the_time("F jS, Y")));
    }
    $postClass = get_post_class();
    $mClass = "";
    foreach ($postClass as $class) {
        $mClass .= $class . " ";
    }
    print "<article> <!--new post --><header class='" . $mClass . "'>" . $mh2 . "<p>" . $mauthor . $mdate . "</p></header><div class='entry'>";
}
Example #11
0
 public static function createPostObject($getComments = false, $postObject = null)
 {
     global $post;
     if ($postObject != null) {
         setup_postdata($postObject);
     }
     $tags = get_the_tags();
     $categories = get_the_category();
     $params = array('permalink' => get_permalink(), 'post_title' => get_the_title(), 'time' => get_the_time(), 'post_content' => self::getTheContent(), 'post_excerpt' => get_the_excerpt(), 'post_author' => get_the_author(), 'author_link' => get_the_author_link(), 'tags' => self::getTags($tags), 'categories' => self::getCategories($categories), 'thumbnails' => self::getThumbnails($post), 'comments' => '');
     if ($getComments != false) {
         $params['comments'] = self::getComments($post->ID);
     }
     $post_object_var = get_object_vars($post);
     $post_params = $params + $post_object_var;
     //echo '<pre>';
     //print_r($post_params);
     //echo '</pre>';
     //exit();
     return new Post($post_params);
 }
function blog_shortcode($atts, $content = null, $code)
{
    global $wp_filter;
    $the_content_filter_backup = $wp_filter['the_content'];
    extract(shortcode_atts(array('max' => 3, 'meta' => ''), $atts));
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    $query = array('post_type' => 'post', 'posts_per_page' => $max, 'paged' => $paged);
    query_posts($query);
    while (have_posts()) {
        the_post();
        $output .= '<div class="blog_post">';
        $output .= '<h2><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>';
        if ($meta == "true") {
            $output .= '<div class="metaInfo">Posted By ';
            $output .= get_the_author_link();
            $output .= ' / ';
            $output .= get_the_time('F, j, Y');
            $output .= ' / <a href="';
            $output .= get_comments_link();
            $output .= '">';
            $output .= get_comments_number('0', '1', '%');
            $output .= ' comments</a></div>';
        }
        if (has_post_thumbnail()) {
            $output .= '<div class="portfolio_thumbnail">';
            $thumb = get_post_thumbnail_id();
            $image = vt_resize($thumb, '', 530, 280, true, 70);
            $output .= '<a href="' . get_permalink() . '"><img src="' . $image[url] . '" width="' . $image[width] . '" height="' . $image[height] . '" alt="' . $lbtitle . '" /></a>';
            $output .= '</div>';
        }
        $output .= apply_filters('the_content', get_the_content());
        $output .= '</div>';
    }
    ob_start();
    wp_pagenavi();
    $output .= ob_get_clean();
    wp_reset_query();
    $wp_filter['the_content'] = $the_content_filter_backup;
    return $output;
}
 private static function getPost($dateFormat = false, $customFields = array())
 {
     if (!$dateFormat) {
         $dateFormat = get_option('date_format');
     }
     $tags = get_the_tags();
     $categories = get_the_category();
     $post = array('permalink' => get_permalink(), 'title' => get_the_title(), 'time' => get_the_time($dateFormat), 'content' => self::getTheFilteredContentFromLoop(), 'excerpt' => get_the_excerpt(), 'author' => get_the_author(), 'author_link' => get_the_author_link(), 'the_tags' => self::getTagsAsArray($tags), 'the_categories' => self::getCategoriesAsArray($categories));
     if (!$tags) {
         $post['has_tags'] = false;
     } else {
         $post['has_tags'] = true;
     }
     if (!$categories) {
         $post['has_categories'] = false;
     } else {
         $post['has_categories'] = true;
     }
     $post = self::addCustomFieldsToPost($customFields, $post);
     $post = self::addThumbnailsToPost($post);
     return $post;
 }
 function widget($args, $instance)
 {
     extract($args, EXTR_SKIP);
     $instance = wp_parse_args($instance, array('title' => __('Popular Questions', 'dwqa'), 'number' => 5));
     echo $before_widget;
     echo $before_title;
     echo $instance['title'];
     echo $after_title;
     $args = array('posts_per_page' => $instance['number'], 'order' => 'DESC', 'orderby' => 'meta_value_num', 'meta_key' => '_dwqa_views', 'post_type' => 'dwqa-question', 'suppress_filters' => false);
     $questions = new WP_Query($args);
     if ($questions->have_posts()) {
         echo '<div class="dwqa-popular-questions">';
         echo '<ul>';
         while ($questions->have_posts()) {
             $questions->the_post();
             echo '<li><a href="' . get_permalink() . '" class="question-title">' . get_the_title() . '</a> ' . __('asked by', 'dwqa') . ' ' . get_the_author_link() . '</li>';
         }
         echo '</ul>';
         echo '</div>';
     }
     wp_reset_query();
     wp_reset_postdata();
     echo $after_widget;
 }
 protected function content($atts, $content = null)
 {
     $options = get_option('sf_dante_options');
     $title = $category = $item_class = $excerpt_length = $width = $offset = $el_class = $output = $filter = $items = $el_position = $item_count = '';
     extract(shortcode_atts(array('title' => '', 'show_title' => 'yes', 'show_excerpt' => 'yes', "excerpt_length" => '20', "item_count" => '12', "show_details" => 'yes', "offset" => '0', "posts_order" => 'ASC', "category" => 'all', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts));
     // CATEGORY SLUG MODIFICATION
     if ($category == "All") {
         $category = "all";
     }
     if ($category == "all") {
         $category = '';
     }
     $category_slug = str_replace('_', '-', $category);
     global $post, $wp_query, $sf_carouselID;
     if ($sf_carouselID == "") {
         $sf_carouselID = 1;
     } else {
         $sf_carouselID++;
     }
     $blog_args = array('post_type' => 'post', 'post_status' => 'publish', 'no_found_rows' => 1, 'category_name' => $category_slug, 'posts_per_page' => $item_count, 'offset' => $offset, 'order' => $posts_order);
     $blog_items = new WP_Query($blog_args);
     $count = $columns = 0;
     $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true);
     if (is_singular('portfolio')) {
         $sidebar_config = "no-sidebars";
     }
     if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") {
         $item_class = 'span2';
     } else {
         if ($sidebar_config == "both-sidebars") {
             $item_class = 'span-bs-quarter';
         } else {
             $item_class = 'span3';
         }
     }
     if ($width == "1/4") {
         $columns = 1;
     } else {
         if ($width == "1/2") {
             $columns = 2;
         } else {
             if ($width == "3/4") {
                 $columns = 3;
             } else {
                 $columns = 4;
             }
         }
     }
     $items .= '<div class="carousel-wrap">';
     $items .= '<div id="carousel-' . $sf_carouselID . '" class="blog-items carousel-items clearfix" data-columns="' . $columns . '">';
     while ($blog_items->have_posts()) {
         $blog_items->the_post();
         $item_title = get_the_title();
         $post_author = get_the_author_link();
         $post_date = get_the_date();
         $post_comments = get_comments_number();
         $post_category = get_the_category();
         $thumb_type = sf_get_post_meta($post->ID, 'sf_thumbnail_type', true);
         $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full');
         $thumb_video = sf_get_post_meta($post->ID, 'sf_thumbnail_video_url', true);
         $thumb_gallery = rwmb_meta('sf_thumbnail_gallery', 'type=image&size=thumb-image');
         $thumb_link_type = sf_get_post_meta($post->ID, 'sf_thumbnail_link_type', true);
         $thumb_link_url = sf_get_post_meta($post->ID, 'sf_thumbnail_link_url', true);
         $thumb_lightbox_thumb = rwmb_meta('sf_thumbnail_image', 'type=image&size=large');
         $thumb_lightbox_image = rwmb_meta('sf_thumbnail_link_image', 'type=image&size=large');
         $thumb_lightbox_video_url = sf_get_post_meta($post->ID, 'sf_thumbnail_link_video_url', true);
         $thumb_lightbox_video_url = sf_get_embed_src($thumb_lightbox_video_url);
         foreach ($thumb_image as $detail_image) {
             $thumb_img_url = $detail_image['url'];
             break;
         }
         if (!$thumb_image) {
             $thumb_image = get_post_thumbnail_id();
             $thumb_img_url = wp_get_attachment_url($thumb_image, 'full');
         }
         $thumb_lightbox_img_url = wp_get_attachment_url($thumb_lightbox_image, 'full');
         $item_title = get_the_title();
         $post_permalink = get_permalink();
         $custom_excerpt = sf_get_post_meta($post->ID, 'sf_custom_excerpt', true);
         $post_excerpt = '';
         if ($custom_excerpt != '') {
             $post_excerpt = sf_custom_excerpt($custom_excerpt, $excerpt_length);
         } else {
             $post_excerpt = sf_excerpt($excerpt_length);
         }
         if ($thumb_link_type == "link_to_url") {
             $link_config = 'href="' . $thumb_link_url . '" class="link-to-url"';
             $item_icon = "ss-link";
         } else {
             if ($thumb_link_type == "link_to_url_nw") {
                 $link_config = 'href="' . $thumb_link_url . '" class="link-to-url" target="_blank"';
                 $item_icon = "ss-link";
             } else {
                 if ($thumb_link_type == "lightbox_thumb") {
                     $link_config = 'href="' . $thumb_img_url . '" class="lightbox" data-rel="ilightbox[' . $post_ID . ']"';
                     $item_icon = "ss-view";
                 } else {
                     if ($thumb_link_type == "lightbox_image") {
                         $lightbox_image_url = '';
                         foreach ($thumb_lightbox_image as $image) {
                             $lightbox_image_url = $image['full_url'];
                         }
                         $link_config = 'href="' . $lightbox_image_url . '" class="lightbox" data-rel="ilightbox[' . $post_ID . ']"';
                         $item_icon = "ss-view";
                     } else {
                         if ($thumb_link_type == "lightbox_video") {
                             $link_config = 'data-video="' . $thumb_lightbox_video_url . '" href="#" class="fw-video-link"';
                             $item_icon = "ss-video";
                         } else {
                             $link_config = 'href="' . $post_permalink . '" class="link-to-post"';
                             $item_icon = "ss-navigateright";
                         }
                     }
                 }
             }
         }
         $items .= '<div itemscope data-id="id-' . $count . '" class="clearfix carousel-item recent-post ' . $item_class . '">';
         $items .= '<figure class="animated-overlay overlay-alt">';
         // THUMBNAIL MEDIA TYPE SETUP
         if ($thumb_type == "video") {
             $video = sf_video_embed($thumb_video, 270, 202);
             $items .= $video;
         } else {
             if ($thumb_type == "slider") {
                 $items .= '<div class="flexslider thumb-slider"><ul class="slides">';
                 foreach ($thumb_gallery as $image) {
                     $alt = $image['alt'];
                     if (!$alt) {
                         $alt = $image['title'];
                     }
                     $items .= "<li><a " . $link_config . "><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$alt}' /></a></li>";
                 }
                 $items .= '</ul></div>';
             } else {
                 if ($thumb_img_url == "") {
                     $thumb_img_url = "default";
                 }
                 $image = sf_aq_resize($thumb_img_url, 420, 315, true, false);
                 if ($image) {
                     $items .= '<img itemprop="image" src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" alt="' . $item_title . '" />';
                     $items .= '<a ' . $link_config . '></a>';
                     if ($show_title == "yes") {
                         $items .= '<figcaption><div class="thumb-info thumb-info-alt">';
                         $items .= '<i class="' . $item_icon . '"></i>';
                         $items .= '</div></figcaption>';
                     } else {
                         $items .= '<figcaption><div class="thumb-info">';
                         $items .= '<h4>' . $item_title . '</h4>';
                         $items .= '<i class="' . $item_icon . '"></i>';
                         $items .= '</div></figcaption>';
                     }
                 }
             }
         }
         $items .= '</figure>';
         $items .= '<div class="details-wrap">';
         // POST TITLE
         if ($show_title == "yes") {
             $items .= '<h5><a href="' . $post_permalink . '">' . $item_title . '</a></h5>';
         }
         if ($show_details == "yes") {
             $items .= '<div class="post-details">' . sprintf(__('%1$s - %2$s', 'swiftframework'), $post_date, sf_get_comments_number($post->ID)) . '</div>';
         }
         // POST EXCERPT
         if ($excerpt_length != "0" && $show_excerpt == "yes") {
             $items .= '<div class="excerpt">' . $post_excerpt . '</div>';
         }
         $items .= '</div>';
         $items .= '</div>';
         $count++;
     }
     wp_reset_query();
     wp_reset_postdata();
     $items .= '</div>';
     $items .= '<a href="#" class="carousel-prev"><i class="ss-navigateleft"></i></a><a href="#" class="carousel-next"><i class="ss-navigateright"></i></a>';
     $options = get_option('sf_dante_options');
     if ($options['enable_swipe_indicators']) {
         $items .= '<div class="sf-swipe-indicator"></div>';
     }
     $items .= '</div>';
     $width = spb_translateColumnWidthToSpan($width);
     $el_class = $this->getExtraClass($el_class);
     $output .= "\n\t" . '<div class="spb_posts_carousel_widget spb_content_element ' . $width . $el_class . '">';
     $output .= "\n\t\t" . '<div class="spb_wrapper carousel-wrap alt-nav">';
     if ($title != '') {
         if ($width == "col-sm-12") {
             $output .= "\n\t\t\t" . '<div class="heading-wrap"><h3 class="spb-heading spb-center-heading"><span>' . $title . '</span></h3></div>';
         } else {
             $output .= "\n\t\t\t" . '<div class="heading-wrap"><h3 class="spb-heading"><span>' . $title . '</span></h3></div>';
         }
     }
     $output .= "\n\t\t\t\t" . $items;
     $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper');
     $output .= "\n\t" . '</div> ' . $this->endBlockComment($width);
     $output = $this->startRow($el_position) . $output . $this->endRow($el_position);
     global $sf_include_carousel, $sf_include_isotope;
     $sf_include_carousel = true;
     $sf_include_isotope = true;
     return $output;
 }
Example #16
0
if (!is_singular()) {
    echo '<a href="' . get_permalink() . '">';
}
the_title();
if (!is_singular()) {
    echo '</a>';
}
?>
</<?php 
echo $heading;
?>
>

      <div class="post-meta post-pad-left">
        <?php 
echo sprintf(__('Posted at %1$s on %2$s by %3$s', 'agency'), get_the_time(get_option('time_format')), get_the_time(get_option('date_format')), get_the_author_link());
?>
      </div>

      <div class="post-pad-left clearfix">
        <?php 
the_content();
?>
      </div>

    </article>

    <?php 
if (comments_open() && !post_password_required()) {
    comments_template();
}
Example #17
0
}
?>

                <?php 
$news_args = array('post_type' => 'post', 'posts_per_page' => -1);
if (isset($hnmOpt['news_cats']) && !empty($hnmOpt['news_cats'])) {
    $news_cats = $hnmOpt['news_cats'];
    $news_args['tax_query'] = array(array('taxonomy' => 'category', 'field' => 'id', 'terms' => $news_cats));
}
$news = new WP_Query($news_args);
?>

                <?php 
if ($news->have_posts()) {
    while ($news->have_posts()) {
        $news->the_post();
        ?>

                    <div class="col-sm-12">
                        <div class="news-covering">
                            <div class="col-sm-2 image-section">
                                <?php 
        the_post_thumbnail('news-updates');
        ?>
                                <h2><?php 
        echo get_the_date();
        ?>
</h2>
                            </div>
                            <div class="col-sm-10 news-detail">
                                <h2>
Example #18
0
global $sf_has_gallery;
$sf_has_gallery = true;
$same_category_navigation = false;
if (isset($options['same_category_navigation'])) {
    $same_category_navigation = $options['same_category_navigation'];
}
?>


<?php 
if (have_posts()) {
    the_post();
    ?>
	
	<?php 
    $post_author = get_the_author_link();
    $post_date = get_the_date();
    $post_categories = get_the_category_list(', ');
    $figure = $main_slider = $thumb_slider = "";
    $gallery_images = rwmb_meta('sf_gallery_images', 'type=image&size=full-width-image-gallery');
    $thumb_images = rwmb_meta('sf_gallery_images', 'type=image&size=thumb-square');
    $figure .= '<div class="spb_gallery_widget">';
    $main_slider .= '<div class="flexslider gallery-slider" data-transition="slide"><ul class="slides">' . "\n";
    foreach ($gallery_images as $image) {
        $main_slider .= "<li><a href='{$image['url']}' class='view' rel='gallery-{$post->ID}'><img src='{$image['url']}' width='{$image['width']}' height='{$image['height']}' alt='{$image['alt']}' /></a>" . "\n";
        if ($image['caption'] != "") {
            $main_slider .= '<p class="flex-caption">' . $image['caption'] . '</p>';
        }
        $main_slider .= "</li>" . "\n";
    }
    $main_slider .= '</ul></div>' . "\n";
Example #19
0
            ?>
					<?php 
            the_title();
            ?>
				<?php 
        }
        ?>
			</h2>

			<ul class="post-meta">
				<?php 
        $twitter_account = get_the_author_meta('twitter');
        $twitter_link = !empty($twitter_account) ? ' <a class="twitter-link" href="http://twitter.com/' . $twitter_account . '"><span class="fa fa-twitter"></span>' . $twitter_account . '</a>' : '';
        ?>
				<li class="post-meta-author"><?php 
        printf(__('By %s', 'willow'), get_the_author_link() . $twitter_link);
        ?>
</li>
				<li class="post-meta-date"><?php 
        echo get_the_date();
        ?>
</li>
				<li class="post-meta-category"><?php 
        the_category(',');
        ?>
</li>
			</ul>

			<div class="post-content">
				<?php 
        ob_start();
Example #20
0
    ?>
        <?php 
}
?>

    <div class="post-body <?php 
if (!get_the_post_thumbnail()) {
    ?>
no-thumbnail<?php 
}
?>
">
        <div class="post-meta">
            <div class="post-meta-author">
                <a href="<?php 
echo get_the_author_link();
?>
"><?php 
the_author();
?>
</a>
            </div><!-- /.post-meta-author -->

            <div class="post-date">
                <?php 
echo get_the_date();
?>
            </div><!-- /.post-date -->

            <div class="post-comments">
                <?php 
							<article id="post-<?php 
        the_ID();
        ?>
" <?php 
        post_class('cf');
        ?>
 role="article">

								<header class="article-header">

									<h1 class="single-title custom-post-type-title"><?php 
        the_title();
        ?>
</h1>
									<p class="byline vcard"><?php 
        printf(__('Posted <time class="updated" datetime="%1$s" itemprop="datePublished">%2$s</time> by <span class="author">%3$s</span> <span class="amp">&</span> filed under %4$s.', 'wp_mattiana_theme'), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), get_the_author_link(get_the_author_meta('ID')), get_the_term_list($post->ID, 'custom_cat', ' ', ', ', ''));
        ?>
</p>

								</header>

								<section class="entry-content cf">
									<?php 
        // the content (pretty self explanatory huh)
        the_content();
        /*
         * Link Pages is used in case you have posts that are set to break into
         * multiple pages. You can remove this if you don't plan on doing that.
         *
         * Also, breaking content up into multiple pages is a horrible experience,
         * so don't do it. While there are SOME edge cases where this is useful, it's
Example #22
0
        ?>
" <?php 
        post_class('cf');
        ?>
 role="article" itemscope itemtype="http://schema.org/BlogPosting">

								<header class="article-header">

									<h1 class="page-title" itemprop="headline"><?php 
        the_title();
        ?>
</h1>

									<p class="byline vcard">
										<?php 
        printf(__('Posted', 'bonestheme') . ' <time class="updated" datetime="%1$s" itemprop="datePublished">%2$s</time> ' . __('by', 'bonestheme') . ' <span class="author">%3$s</span>', get_the_time('Y-m-j'), get_the_time(get_option('date_format')), get_the_author_link(get_the_author_meta('ID')));
        ?>
									</p>

								</header> <?php 
        // end article header
        ?>

								<section class="entry-content cf" itemprop="articleBody">
									<?php 
        // the content (pretty self explanatory huh)
        the_content();
        /*
         * Link Pages is used in case you have posts that are set to break into
         * multiple pages. You can remove this if you don't plan on doing that.
         *
Example #23
0
								<header class="article-header">

									<h1 class="h2 entry-title"><a href="<?php 
        the_permalink();
        ?>
" rel="bookmark" title="<?php 
        the_title_attribute();
        ?>
"><?php 
        the_title();
        ?>
</a></h1>
									<p class="byline vcard">
                                        <?php 
        printf(__('Posted <time class="updated" datetime="%1$s" pubdate>%2$s</time> by <span class="author">%3$s</span>', 'bonestheme'), get_the_time('Y-m-j'), get_the_time(get_option('date_format')), get_the_author_link(get_the_author_meta('ID')));
        ?>
									</p>

								</header>

								<section class="entry-content cf">
									<?php 
        the_content();
        ?>
								</section>

								<footer class="article-footer cf">
									<p class="footer-comment-count">
										<?php 
        comments_number(__('<span>No</span> Comments', 'bonestheme'), __('<span>One</span> Comment', 'bonestheme'), __('<span>%</span> Comments', 'bonestheme'));
Example #24
0
/**
 * Display either author's link or author's name.
 *
 * If the author has a home page set, echo an HTML link, otherwise just echo the
 * author's name.
 *
 * @link http://codex.wordpress.org/Template_Tags/the_author_link
 * @since 2.1
 * @uses get_the_author_link()
 */
function the_author_link()
{
    echo get_the_author_link();
}
Example #25
0
              <article id="post-<?php 
the_ID();
?>
" role="article" itemscope itemprop="blogPost" itemtype="http://schema.org/BlogPosting">

                <header>

                  <h1 class="single-title" itemprop="headline" rel="bookmark"><?php 
the_title();
?>
</h1>

                  <p class="vcard">

                    <?php 
printf(__('Posted %1$s %2$s', 'bonestheme'), '<time class="updated entry-time" datetime="' . get_the_time('Y-m-d') . '" itemprop="datePublished">' . get_the_time(get_option('date_format')) . '</time>', '<span class="by">by</span> <span class="entry-author author" itemprop="author" itemscope itemptype="http://schema.org/Person">' . get_the_author_link(get_the_author_meta('ID')) . '</span>');
?>

                  </p>

                </header> <?php 
// end article header
?>

                <section itemprop="articleBody">
                  <?php 
the_content();
?>
                </section> <?php 
// end article section
?>
 function parse_output($instance)
 {
     $output = '';
     foreach ($this->default_config as $key => $val) {
         ${$key} = empty($instance[$key]) ? $val : $instance[$key];
     }
     $default_query_args = array('post_type' => 'post', 'posts_per_page' => $count, 'orderby' => 'date', 'order' => 'DESC');
     $query_args = json_decode($wp_query_options, true);
     if ($query_args == NULL) {
         $query_args = array();
     }
     $the_query = new WP_Query(array_merge($default_query_args, $query_args));
     if ($the_query->have_posts()) {
         //Deal with custom meta tags, e.g. [META[key]]
         $meta_matches = array();
         preg_match_all('/\\{META\\[(.*?)\\]\\}/', $widget_output_template, $meta_matches);
         //check if custom ellipsis has been defined, use strpos before preg_match since it is a lot faster
         $truncate_elipsis_template = '';
         if (preg_match('/\\{ELLIPSIS\\}(.*?)\\{\\/ELLIPSIS\\}/', $widget_output_template, $ellipsis_match) > 0) {
             $truncate_elipsis_template = $ellipsis_match[1];
         }
         while ($the_query->have_posts()) {
             $the_query->the_post();
             $ID = get_the_ID();
             $image_id = get_post_thumbnail_id();
             $image_url = wp_get_attachment_image_src($image_id, 'related');
             $image_url = $image_url[0];
             if (has_post_thumbnail()) {
                 $POST_THUMBNAIL = "<a href=\"" . get_permalink($ID) . "\" title=\"" . get_the_title($ID) . "\" ><img src=\"" . $image_url . "\" class=\"wp-post-image\"></a>";
             } else {
                 $POST_THUMBNAIL = "<a href=\"" . get_permalink($ID) . "\" title=\"" . get_the_title($ID) . "\" ><img src=\"" . get_template_directory_uri() . "/images/smallthumb.png\" class=\"wp-post-image\"></a>";
             }
             $POST_TITLE_RAW = strip_tags(get_the_title($ID));
             if (empty($truncate_post_title)) {
                 $POST_TITLE = $POST_TITLE_RAW;
             } else {
                 if ($truncate_post_title_type == "word") {
                     $POST_TITLE = $this->_truncate_words($POST_TITLE_RAW, $truncate_post_title, $truncate_elipsis);
                 } else {
                     $POST_TITLE = $this->_truncate_chars($POST_TITLE_RAW, $truncate_post_title, $truncate_elipsis);
                 }
             }
             $widget_ouput_template_params = array('{ID}' => $ID, '{THUMBNAIL}' => $POST_THUMBNAIL, '{TITLE_RAW}' => $POST_TITLE_RAW, '{TITLE}' => $POST_TITLE, '{PERMALINK}' => get_permalink($ID), '{AUTHOR}' => get_the_author(), '{AUTHOR_LINK}' => get_the_author_link(), '{AUTHOR_AVATAR}' => strpos($widget_output_template, '{AUTHOR_AVATAR}') !== FALSE ? get_avatar(get_the_author_meta('user_email')) : "", '{COMMENT_COUNT}' => strpos($widget_output_template, '{COMMENT_COUNT}') !== FALSE ? get_comments_number() : "");
             //Deal with meta fields
             foreach ($meta_matches[0] as $key => $meta_match) {
                 if (!empty($meta_matches[1][$key])) {
                     $widget_ouput_template_params[$meta_match] = get_post_meta($ID, $meta_matches[1][$key], true);
                 } else {
                     $widget_ouput_template_params[$meta_match] = '';
                 }
             }
             //Deal with {ELLIPSIS}{/ELLIPSIS} tags, we parse it with the template tags, so you can use these tags in the excerpt
             $truncate_elipsis_excerpt = $truncate_elipsis;
             if (!empty($truncate_elipsis_template)) {
                 $truncate_elipsis_excerpt = str_replace(array_keys($widget_ouput_template_params), array_values($widget_ouput_template_params), $truncate_elipsis_template);
                 $widget_output_template = preg_replace('/\\{ELLIPSIS\\}(.*?)\\{\\/ELLIPSIS\\}/', '', $widget_output_template);
                 //remove {ELLIPSIS}{/ELLIPSIS} tags from widget_output_template
             }
             //Deal with post excerpt
             if ($include_post_excerpt == "false") {
                 $POST_EXCERPT_RAW = $POST_EXCERPT = '';
             } else {
                 $POST_EXCERPT_RAW = $this->_custom_trim_excerpt();
                 if (empty($truncate_post_excerpt)) {
                     $POST_EXCERPT = $POST_EXCERPT_RAW;
                 } else {
                     $POST_EXCERPT = $this->_custom_trim_excerpt($truncate_post_excerpt, $truncate_elipsis_excerpt, $truncate_post_excerpt_type);
                 }
             }
             $widget_ouput_template_params['{EXCERPT_RAW}'] = $POST_EXCERPT_RAW;
             $widget_ouput_template_params['{EXCERPT}'] = $POST_EXCERPT;
             //Deal with embedded php code, only evan if php tags exist and current user is admin
             $widget_output_template_eval = $widget_output_template;
             if (preg_match("/<\\?(.*?)\\?>/", $widget_output_template) > 0) {
                 ob_start();
                 $eval_result = eval("?>" . $widget_output_template);
                 $widget_output_template_eval = ob_get_clean();
             }
             $output .= str_replace(array_keys($widget_ouput_template_params), array_values($widget_ouput_template_params), $widget_output_template_eval);
         }
         //end while
     }
     wp_reset_postdata();
     return $output;
 }
function theme_post_info($atts = null, $content = null)
{
    $output = '<ul class="post-info">';
    $output .= '<li class="date">' . get_the_date("F j, Y") . '</li>';
    $output .= '<li class="author">' . get_the_author_link() . '</li>';
    $output .= '</ul><div style="clear: both"></div>';
    return $output;
}
 function agama_render_blog_post_meta()
 {
     echo sprintf('%s <span class="vcard"><span class="fn">%s</span></span>', '<i class="fa fa-user"></i>', get_the_author_link());
     echo '<span class="inline-sep">/</span>';
     echo sprintf('%s <span>%s</span>', '<i class="fa fa-calendar"></i>', get_the_time('F j, Y'));
     // Output next details only on list blog layout or on single post page
     if (get_theme_mod('agama_blog_layout', 'list') == 'list' || is_single()) {
         echo '<span class="inline-sep">/</span>';
         echo sprintf('%s %s', '<i class="fa fa-folder-open"></i>', get_the_category_list(', '));
         echo '<span class="inline-sep">/</span>';
         // Comments number
         if (comments_open()) {
             echo sprintf('%s <a href="%s">%s</a>', '<i class="fa fa-comments"></i>', get_comments_link(), get_comments_number() . __(' comments', 'agama'));
         }
     }
 }
Example #29
0
function print_blog_full($item_class, $item_size, $num_excerpt)
{
    global $gdl_admin_translator;
    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');
    }
    $_i = 1;
    while (have_posts()) {
        the_post();
        echo '<div class="blog-item gdl-divider ' . $item_class . ' mt0">';
        echo '<h2 class="blog-thumbnail-title post-title-color gdl-title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>';
        echo '<div class="blog-thumbnail-info post-info-color">';
        echo '<div class="blog-thumbnail-date">' . get_the_time('M d, Y') . '</div>';
        echo '<div class="blog-thumbnail-author"> ' . __('by', 'gdl_front_end') . ' ' . get_the_author_link() . '</div>';
        the_tags('<div class="single-thumbnail-tag">', ', ', '</div>');
        echo '<div class="blog-thumbnail-comment">';
        comments_popup_link(__('0', 'gdl_front_end'), __('1', 'gdl_front_end'), __('%', 'gdl_front_end'), '', __('Comments are off', 'gdl_front_end'));
        echo '</div>';
        echo '<div class="clear"></div>';
        echo '</div>';
        print_blog_thumbnail(get_the_ID(), $item_size);
        echo '<div class="blog-thumbnail-context">';
        echo '<div class="blog-thumbnail-content">' . mb_substr(get_the_excerpt(), 0, $num_excerpt) . '</div>';
        echo '<a class="blog-continue-reading" href="' . get_permalink() . '"><em>' . $translator_continue_reading . '</em></a>';
        echo '</div>';
        // blog-thumbnail-context
        $is_odd = $_i % 2 != 0 ? true : false;
        //奇数偶数
        echo '<span class="post_type_label' . ($is_odd ? ' is_odd' : ' is_event') . '"><span class="post_type_label_d">' . get_the_time('d') . '</span><span class="post_type_label_spacer">/</span><span class="post_type_label_m">' . get_the_time('M') . '</span></span>';
        //显示文章日期标签 20150716
        echo '</div>';
        // blog-item
        $_i++;
    }
    unset($_i);
}
Example #30
0
function ts_recent_posts_func($atts, $content = null)
{
    extract(shortcode_atts(array("limit" => 10), $atts));
    if (!(int) $limit) {
        $limit = 10;
    }
    $rand = rand(1, 1000);
    global $query_string, $post;
    $args = array('posts_per_page' => $limit, 'offset' => 0, 'cat' => '', 'orderby' => 'date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post', 'post_mime_type' => '', 'post_parent' => '', 'paged' => 1, 'post_status' => 'publish');
    $the_query = new WP_Query($args);
    $content = '';
    if ($the_query->have_posts()) {
        $list = '';
        $i = 0;
        while ($the_query->have_posts()) {
            $the_query->the_post();
            $comments = get_comments_number();
            switch ($comments) {
                case 0:
                    $comments_msg = __('No comments', 'circles');
                    break;
                case 1:
                    $comments_msg = __('1 Comment', 'circles');
                    break;
                default:
                    $comments_msg = sprintf(__('%s Comments', 'circles'), $comments);
                    break;
            }
            if ($i > 0) {
                $list .= '<div class="separator"></div>';
            }
            $list .= '
				<article class="post link left">
					<header>
							<a href="' . get_permalink() . '"><h2>' . get_the_title() . '</h2></a>
					</header>
					<footer>
							<div class="post-helper-absolute">
								<div class="post-day-aside">
									<span>' . get_the_time('d') . '</span>
								</div>
								<div class="post-month-aside">
									<span>' . get_the_time('M') . ', ' . get_the_time('Y') . '</span>
								</div>
							</div>
							<div class="post-author inline">
								' . __('By', 'circles') . '
								<span>
									' . get_the_author_link() . '
								</span>
							</div>
							<div class="post-category">
								<span>
									' . get_the_category_list(', ', '', $post->ID) . '
								</span>
							</div>
							<div class="post-comments inline">
								<span><a href="">' . $comments_msg . '</a></span>
							</div>
						</footer>
						<div class="post-body-text">
							
							<p>' . ts_get_the_excerpt_theme('short') . ' <a class="read-more" href="' . get_permalink() . '">' . __('read more', 'circles') . '</a></p>
						</div>
				</article>';
            $i++;
        }
        $content = '
			<section class="grid_12 recent-posts">
				' . $list . '
			</section>';
    }
    // Restor original Query & Post Data
    wp_reset_query();
    wp_reset_postdata();
    return $content;
}