Exemplo n.º 1
0
        function categori_news(){
            query_posts('cat=9&showposts=10&posts_per_page=3');

            while (have_posts()) : the_post();
                /*Dima insert*/the_excerpt(); ?>
                <div class="content-box">
                    <div class="bgr01"><div class="bgr02"><div class="bgr03">
                                <div <?php post_class() ?> id="post-<?php the_ID(); ?>" style=" float:none; ">
                                    <div class="title">
                                        <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
                                        <div class="date_all">
                                            <?php the_time('l, j ?F, Y') ?>
                                        </div>
                                        <div class="post">
                                            Написал <?php the_author_link() ?> <?php the_time('g:i A') ?>
                                        </div>
                                    </div>
                                    <div class="content_box">
                                        <?php the_content('Читать всё'); ?>
                                    </div>

                                    <div class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?></div>

                                    <div class="comments"><?php comments_popup_link('0 комментарии', 'комментарии', '% комментарии '); ?></div>
                                    <div class="link-edit"><?php edit_post_link('Edit', ''); ?></div>
                                </div>
                            </div></div></div>
                </div>
            <?php endwhile;}
Exemplo n.º 2
0
function maxitheme_author()
{
    echo '<div class="entry-meta"><span class="vcard author">';
    echo esc_html__('by ', 'maxitheme');
    echo '<span class="fn" itemprop="name">';
    echo the_author_link();
    echo '</span></span></div>';
}
Exemplo n.º 3
0
    function widget($args, $instance)
    {
        extract($args);
        echo $before_widget;
        ?>
			<div class="widget">
				<h4><?php 
        echo apply_filters('widget_title', $instance['heading']);
        ?>
</h4>
				<?php 
        $the_query = new WP_Query('posts_per_page=5');
        ?>
				<?php 
        while ($the_query->have_posts()) {
            $the_query->the_post();
            ?>
					<article class="post-thumb">
						<?php 
            if (has_post_thumbnail()) {
                echo '<figure><a href="', the_permalink(), '">';
                the_post_thumbnail(array(80, ''), array('class' => 'img-responsive'));
                echo '</a></figure>';
            }
            ?>
						<div class="body">
							<h5 class="title"><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h5>
							<p class="meta">						
								<span class="author"><a href="<?php 
            the_author_link();
            ?>
"><?php 
            the_author();
            ?>
</a></span>
								<span class="date"><?php 
            the_time('d.m.Y');
            ?>
</span>
							</p>
						</div>
					</article>
				<?php 
        }
        wp_reset_postdata();
        ?>
			</div>				
		<?php 
        echo $after_widget;
    }
    function elitepress_post_meta_content()
    {
        ?>
   
	        <!--show date of post-->
			
			<div class="blog-post-info-detail">
				<span class="blog_tags">
						<?php 
        _e('By', 'elitepress');
        ?>
<a href="<?php 
        echo get_author_posts_url(get_the_author_meta('ID'));
        ?>
"><?php 
        the_author_link();
        ?>
</a>
								
						<?php 
        _e('On', 'elitepress');
        ?>
<a href="<?php 
        the_permalink();
        ?>
"><?php 
        echo get_the_date();
        ?>
</a>
								
						<?php 
        $tag_list = get_the_tag_list();
        if (!empty($tag_list)) {
            ?>
						<div class="blog-tags"><?php 
            _e('In', 'elitepress');
            the_tags('', ', ', '');
            ?>
,<?php 
            $cat_list = get_the_category_list();
            if (!empty($cat_list)) {
                the_category(', ');
            }
            ?>
						</div><?php 
        }
        ?>
				</span>
			</div>
			
			
			<?php 
    }
Exemplo n.º 5
0
function ace_post_author()
{
    if (get_option('ace_blog_author')) {
    } else {
        echo '<li class="post-author">';
        echo '<span>Author:</span>';
        echo ' <span class="vcard author" itemprop="author" itemscope="itemscope" itemtype="http://schema.org/Person"><span class="fn" itemprop="name" style="font-weight:400; text-transform:capitalize;">';
        the_author_link();
        echo '</span></span>';
        echo '</li>';
    }
}
Exemplo n.º 6
0
function get_template_title()
{
    $title = '';
    ob_start();
    _e('Author Archives', 'blankslate');
    $title .= ob_get_contents();
    ob_clean();
    $title .= ': ';
    the_author_link();
    $title .= ob_get_contents();
    ob_end_clean();
    return $title;
}
Exemplo n.º 7
0
/**
 * Displays post meta based on $meta_data
 *
 * @since 1.0.0
 * @param array $meta_data Array of meta data to display.
 * @param array $args Array of display settings.
 */
function portland_post_meta($meta_data = array(), $args = array())
{
    $defaults = array('class_name' => '', 'separator' => '&bull;', 'display_titles' => true);
    $args = array_merge($defaults, $args);
    echo '<div class="portland-meta ' . $args['class_name'] . '">';
    if (!empty($meta_data)) {
        $display_separator = false;
        foreach ($meta_data as $meta) {
            switch ($meta) {
                case 'author':
                    if ($display_separator) {
                        echo '<span class="portland-meta-separator"> ' . $args['separator'] . ' </span>';
                    }
                    echo '<span class="meta author-wrap">';
                    if ($args['display_titles']) {
                        _e('By ', 'portland_textdomain');
                    }
                    echo '<span class="author">';
                    the_author();
                    echo '</span>';
                    echo '</span> ';
                    $display_separator = true;
                    break;
                case 'author_website':
                    if ($display_separator) {
                        echo '<span class="portland-meta-separator"> ' . $args['separator'] . ' </span>';
                    }
                    echo '<span class="meta author-wrap">';
                    if ($args['display_titles']) {
                        _e('By ', 'portland_textdomain');
                    }
                    echo '<span class="author">';
                    the_author_link();
                    echo '</span>';
                    echo '</span> ';
                    $display_separator = true;
                    break;
                case 'author_posts':
                    if ($display_separator) {
                        echo '<span class="portland-meta-separator"> ' . $args['separator'] . ' </span>';
                    }
                    echo '<span class="meta author-wrap">';
                    if ($args['display_titles']) {
                        _e('By ', 'portland_textdomain');
                    }
                    echo '<span class="author">';
                    the_author_posts_link();
                    echo '</span>';
                    echo '</span> ';
                    $display_separator = true;
                    break;
                case 'categories':
                    if (has_category()) {
                        if ($display_separator) {
                            echo '<span class="portland-meta-separator"> ' . $args['separator'] . ' </span>';
                        }
                        echo '<span class="meta categories-wrap">';
                        if ($args['display_titles']) {
                            _e('Posted in: ', 'portland_textdomain');
                        }
                        echo '<span class="categories">';
                        the_category(', ');
                        echo '</span>';
                        echo '</span> ';
                        $display_separator = true;
                    }
                    break;
                case 'date':
                    if ($display_separator) {
                        echo '<span class="portland-meta-separator"> ' . $args['separator'] . ' </span>';
                    }
                    echo '<span class="meta date-wrap">';
                    if ($args['display_titles']) {
                        _e('Published: ', 'portland_textdomain');
                    }
                    echo '<span class="date">';
                    the_time(get_option('date_format'));
                    echo '</span>';
                    echo '</span> ';
                    $display_separator = true;
                    break;
                case 'tags':
                    if ($display_separator) {
                        echo '<span class="portland-meta-separator"> ' . $args['separator'] . ' </span>';
                    }
                    echo '<span class="meta tags-wrap">';
                    if ($args['display_titles']) {
                        the_tags(__('Tags: ', 'portland_textdomain'));
                    } else {
                        the_tags();
                    }
                    echo '</span> ';
                    $display_separator = true;
                    break;
                default:
                    # code...
                    break;
            }
        }
    }
    echo '</div>';
}
    public function sensei_lesson_meta($post_id = 0)
    {
        global $post, $woothemes_sensei;
        if (0 < intval($post_id)) {
            $lesson_course_id = absint(get_post_meta($post_id, '_lesson_course', true));
            ?>
<section class="entry">
            <p class="sensei-course-meta">
			    <?php 
            if (isset($woothemes_sensei->settings->settings['lesson_author']) && $woothemes_sensei->settings->settings['lesson_author']) {
                ?>
			    <span class="course-author"><?php 
                _e('by ', 'woothemes-sensei');
                the_author_link();
                ?>
</span>
			    <?php 
            }
            ?>
                <?php 
            if (0 < intval($lesson_course_id)) {
                ?>
                <span class="lesson-course"><?php 
                echo '&nbsp;' . sprintf(__('Part of: %s', 'woothemes-sensei'), '<a href="' . esc_url(get_permalink($lesson_course_id)) . '" title="' . esc_attr(apply_filters('sensei_view_course_text', __('View course', 'woothemes-sensei'))) . '"><em>' . get_the_title($lesson_course_id) . '</em></a>');
                ?>
</span>
                <?php 
            }
            ?>
            </p>
            <p class="lesson-excerpt"><?php 
            echo apply_filters('get_the_excerpt', $post->post_excerpt);
            ?>
</p>
		</section><?php 
        }
        // End If Statement
    }
Exemplo n.º 9
0
    function get_entry_meta()
    {
        ?>
        <p class="entry-meta"><span class="glyphicon glyphicon-time"></span> Posted by <a class="author" href="<?php 
        the_author_link();
        ?>
"><?php 
        the_author();
        ?>
</a>
            <?php 
        if (the_date()) {
            ?>
                on <?php 
            the_date();
            ?>
            <?php 
        }
        ?>
            <?php 
        printf(__('<span class="category"> in %1$s</span>', 'notebook'), get_the_category_list(', '));
        ?>
            <?php 
        if (comments_open()) {
            echo ' | <span class="comments">';
            comments_popup_link(__('Leave a comment', 'notebook'), __('One comment', 'notebook'), __('% comments', 'notebook'), __('Read all comments', 'notebook'));
            echo '</span>';
        }
        ?>
        </p>
        <hr>
    <?php 
    }
Exemplo n.º 10
0
function pego_get_author_data($post)
{
    ?>
	<!--BEGIN .author-bio-->
	<h1>About author</h1>
	<div class="clear"></div>
	<div class="author-bio">
				<?php 
    echo get_avatar(get_the_author_meta('email'), '90');
    ?>
	<div class="author-info">
	<h3 class="author-title"><?php 
    the_author_link();
    ?>
</h3>
	<p class="author-description"><?php 
    the_author_meta('description');
    ?>
	</div>
	<!--END .author-bio-->
	<div class="clear"></div>
	</div>
	<div class="clear"></div>
	<?php 
}
function wp_ajax_query($atts = '')
{
    include_once ABSPATH . 'wp-admin/includes/plugin.php';
    global $waq_id;
    $is_ajax = 0;
    if ($atts == '') {
        $is_ajax = 1;
        $atts = $_GET;
        if ($atts['global_query']) {
            unset($atts['no_found_rows']);
            unset($atts['suppress_filters']);
            unset($atts['cache_results']);
            unset($atts['update_post_term_cache']);
            unset($atts['update_post_meta_cache']);
            unset($atts['nopaging']);
        }
    }
    if ($atts['post_excerpt_limit'] > 0) {
        add_filter('excerpt_length', 'waq_custom_excerpt_length', 999);
    }
    if ($atts['multisite']) {
        switch_to_blog($atts['multisite']);
    }
    foreach ($atts as $key => $val) {
        if ($atts[$key] == null || $atts[$key] == 'null' || $atts[$key] == '') {
            unset($atts[$key]);
        }
    }
    $my_query = null;
    $my_query = new WP_Query($atts);
    $html = '';
    if ($my_query->have_posts()) {
        ob_start();
        if ($atts['layout'] == 'classic') {
            echo '<div>';
        }
        //fix firefox append
        while ($my_query->have_posts()) {
            $my_query->the_post();
            if ($atts['post_type'] == 'attachment') {
                $thumb = wp_get_attachment_image_src(get_the_ID(), $atts['thumb_size']);
                $full = wp_get_attachment_image_src(get_the_ID(), 'large');
            } else {
                $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), $atts['thumb_size']);
                $full = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
            }
            ?>
            <div class="ajax-item">
            	<div class="ajax-item-pad">
				<?php 
            if (has_post_thumbnail() || $atts['post_type'] == 'attachment') {
                if ($atts['thumb_hover_popup']) {
                    ?>
                    <a rel="prettyPhoto[waq<?php 
                    echo $atts['waq_id'];
                    ?>
]" href="<?php 
                    echo $full['0'];
                    ?>
" title="<?php 
                    the_title();
                    ?>
">
                    <?php 
                } else {
                    ?>
                    <a href="<?php 
                    echo get_permalink();
                    ?>
" title="<?php 
                    the_title();
                    ?>
">
                    <?php 
                }
                ?>
                    <div class="ajax-item-thumb">
                    	<img src="<?php 
                echo $thumb['0'];
                ?>
" title="<?php 
                the_title();
                ?>
" alt="<?php 
                the_title();
                ?>
" width="<?php 
                echo $atts['col_width'];
                ?>
" />
                        <?php 
                if ($atts['thumb_hover_icon']) {
                    ?>
                        <div class="link-overlay fa <?php 
                    echo $atts['thumb_hover_icon'];
                    ?>
"></div>
                        <?php 
                }
                ?>
                    </div>
                    </a>
                    <?php 
            }
            ?>
                    <div class="ajax-item-content-wrap <?php 
            echo has_post_thumbnail() ? '' : 'no-thumb';
            ?>
">
                      <?php 
            if ($atts['post_title_size']) {
                ?>
                      <h2 class="ajax-item-head">
                        <a href="<?php 
                echo get_permalink();
                ?>
" title="<?php 
                the_title();
                ?>
">
                        <?php 
                the_title();
                ?>
                        </a>
                      </h2>
                      <br />
                      <?php 
            }
            ?>
                      <?php 
            if ($atts['post_meta_size']) {
                ?>
                      <div class="ajax-item-meta">
                        <?php 
                if (is_plugin_active('woocommerce/woocommerce.php') && $atts['post_type'] == 'product') {
                    //woo product
                    $product = new WC_Product(get_the_ID());
                    ?>
                        <span><?php 
                    echo $product->get_price_html();
                    ?>
 &nbsp;&nbsp;<a href="<?php 
                    echo do_shortcode('[add_to_cart_url id="' . get_the_ID() . '"]');
                    ?>
" title="<?php 
                    _e('Add to cart', 'leafcolor');
                    ?>
"><i class="fa fa-shopping-cart"></i>+</a></span>
                        <?php 
                } else {
                    ?>
                        <span><i class="fa fa-clock-o"></i> <?php 
                    the_time(get_option('date_format'));
                    ?>
 &nbsp;&nbsp;<i class="fa fa-user"></i> <?php 
                    the_author_link();
                    ?>
</span>
                        <?php 
                }
                ?>
                      </div>
                      <br />
                      <?php 
            }
            ?>
                      <?php 
            if ($atts['post_excerpt_size']) {
                ?>
                      <div class="ajax-item-content">
                        <?php 
                if ($atts['full_post'] == 1) {
                    the_content();
                } elseif ($atts['fullpost'] == -1) {
                    echo '';
                } else {
                    the_excerpt();
                }
                ?>
                      </div>
                      <?php 
            }
            ?>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
			<?php 
        }
        wp_reset_postdata();
        if ($atts['layout'] == 'classic') {
            echo '</div>';
        }
        //fix firefox append
        $html = ob_get_clean();
        if ($is_ajax == 1) {
            echo $html;
            exit;
        }
        remove_filter('excerpt_length', 'waq_custom_excerpt_length');
        return $html;
    } else {
        if ($is_ajax == 1) {
            echo '-11';
            exit;
        }
        remove_filter('excerpt_length', 'waq_custom_excerpt_length');
        return 'No post';
    }
    if ($atts['multisite']) {
        restore_current_blog();
    }
}
Exemplo n.º 12
0
/**
* About the author
*/
function thim_about_author()
{
    if (!is_singular('post')) {
        return;
    }
    ?>
	<div class="thim-about-author">
		<div class="author-wrapper">
			<div class="author-avatar">
				<?php 
    echo get_avatar(get_the_author_meta('email'), 90);
    ?>
			</div>
			<div class="author-details">
				<div class="author-bio">
					<p class="name">
						<?php 
    the_author_link();
    ?>
						<?php 
    if (get_the_author_meta('job')) {
        ?>
							<br/><span class="job"><i><?php 
        echo get_the_author_meta('job');
        ?>
</i></span>
						<?php 
    }
    ?>
					</p>
					<p class="description"><?php 
    echo get_the_author_meta('description');
    ?>
</p>

					<?php 
    if (get_the_author_meta('user_url')) {
        ?>
						<p class="url"><?php 
        _e('Website: ', 'mabu');
        ?>
<a href="<?php 
        echo get_the_author_meta('user_url');
        ?>
" target="_blank"><?php 
        echo get_the_author_meta('user_url');
        ?>
</a></p>
					<?php 
    }
    ?>
				</div>
			</div>
		</div>
	</div>
	<?php 
}
function the_post_metas()
{
    $meta = [];
    if (valid_meta(the_date_link())) {
        array_push($meta, the_date_link());
    }
    if (valid_meta(the_author_link())) {
        array_push($meta, the_author_link());
    }
    if (valid_meta(the_category())) {
        array_push($meta, the_category());
    }
    if (valid_meta(get_the_tag_list())) {
        array_push($meta, get_the_tag_list());
    }
    return implode(" | ", $meta);
}
Exemplo n.º 14
0
    /**
     * Front-end display of widget.
     *
     * @see WP_Widget::widget()
     *
     * @param array $args     Widget arguments.
     * @param array $instance Saved values from database.
     */
    public function widget($args, $instance)
    {
        if (!empty($instance['title'])) {
            echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
        }
        ?>
		<aside class="widget sidebar-author">
			<div class="sidebar-author-img">
			<?php 
        $author_email = get_the_author_meta('email');
        echo get_avatar($author_email, '80');
        ?>
			</div>
			
			<span>by <?php 
        the_author_link();
        ?>
</span>
			<p><?php 
        the_author_meta('description');
        ?>
</p>

			<!-- author social -->
			<ul>
				<?php 
        if (get_the_author_meta('user_url')) {
            echo '<li><a title="homepage" target="_blank" rel="nofollow" href="' . get_the_author_meta('user_url') . '"><span class="iconfont icon-blhome"></span></a></li>';
        }
        if (get_the_author_meta('weibo')) {
            echo '<li><a title="weibo" target="_blank" rel="nofollow" href="' . get_the_author_meta('weibo') . '"><span class="iconfont icon-iconweibo"></span></a></li>';
        }
        if (get_the_author_meta('github')) {
            echo '<li><a title="github" target="_blank" rel="nofollow" href="' . get_the_author_meta('github') . '"><span class="iconfont icon-github"></span></a></li>';
        }
        if (get_the_author_meta('twitter')) {
            echo '<li><a title="twitter" target="_blank" rel="nofollow" href="' . get_the_author_meta('twitter') . '"><span class="iconfont icon-twitter"></span></a></li>';
        }
        if (get_the_author_meta('google')) {
            echo '<li><a title="google+" target="_blank" rel="nofollow" href="' . get_the_author_meta('google') . '"><span class="iconfont icon-google"></span></a></li>';
        }
        if (get_the_author_meta('facebook')) {
            echo '<li><a title="facebook" target="_blank" rel="nofollow" href="' . get_the_author_meta('facebook') . '"><span class="iconfont icon-facebook"></span></a></li>';
        }
        if (get_the_author_meta('email')) {
            echo '<li><a title="email" target="_blank" href="mailto:' . get_the_author_meta('email') . '"><span class="iconfont icon-email"></span></a></li>';
        }
        if (get_the_author_meta('douban')) {
            echo '<li><a title="douban" target="_blank" rel="nofollow" href="' . get_the_author_meta('douban') . '"><span class="iconfont icon-douban"></span></a></li>';
        }
        if (get_the_author_meta('linkedin')) {
            echo '<li><a title="linkedin" target="_blank" rel="nofollow" href="' . get_the_author_meta('linkedin') . '"><span class="iconfont icon-linkedin"></span></a></li>';
        }
        if (get_the_author_meta('alipay')) {
            echo '<li class="dropdown"><span class="iconfont icon-zhifufangshi dropdown-toggle" data-toggle="dropdown"></span><div class="dropdown-menu"><p>' . __('Dimensional code scanning alipay funding', 'pits') . '</p><img src="' . get_the_author_meta('alipay') . '"></div></li>';
        }
        if (get_the_author_meta('weixin')) {
            echo '<li class="dropdown"><span class="iconfont icon-weibiaoti1 dropdown-toggle" data-toggle="dropdown"></span><div class="dropdown-menu"><p>' . __('Dimensional code scanning weixin concern', 'pits') . '</p><img src="' . get_the_author_meta('weixin') . '"></div></li>';
        }
        ?>
			</ul>
		</aside>
<?php 
    }
Exemplo n.º 15
0
function wpmu_single_loop()
{
    rewind_posts();
    while (have_posts()) {
        the_post();
        ?>
			<div class="post" id="post-<?php 
        the_ID();
        ?>
">
				<div class="post-content-wp">
					<h2 class="posttitle"><a href="<?php 
        the_permalink();
        ?>
" rel="bookmark" title="<?php 
        _e('Permanent Link to', 'product');
        ?>
 <?php 
        the_title_attribute();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
					<p class="date"><span class="byline"><?php 
        the_time('M j Y');
        ?>
 <?php 
        _e('in', 'product');
        ?>
 <?php 
        the_category(', ');
        ?>
 <em><?php 
        _e('by ', 'product');
        the_author_link();
        ?>
</em></span></p>
					<div class="entry">
						<?php 
        the_content();
        ?>
					</div>
					<p class="postmetadata"><span class="tags"><?php 
        the_tags(__('Tags: ', 'product'), ', ', '<br />');
        ?>
</span> <span class="comments"><?php 
        comments_popup_link(__('No Comments &#187;', 'product'), __('1 Comment &#187;', 'product'), __('% Comments &#187;', 'product'));
        ?>
</span></p>
				</div>
			</div>

			<?php 
        comments_template('', true);
        ?>
			<?php 
    }
}
Exemplo n.º 16
0
function bfa_postinfo($postinfo_string)
{
    // one theme option needed below for nofollow trackback / RSS links yes/no
    global $bfa_ata, $post;
    /* replace date format escape placeholders(#) with the actual escpae
    	character (=backslashes). This function removes all backslashes from
    	post info strings to avoid issues with hosts that have magic_quotes_gpc ON.
    	But we want to keep the backslashes inside date items, because they are
    	needed to escape literal strings inside dates */
    $postinfo_string = str_replace("#", "\\", $postinfo_string);
    $postinfo = $postinfo_string;
    // Author public name
    if (strpos($postinfo_string, '%author%') !== FALSE) {
        ob_start();
        the_author();
        $author = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author%", $author, $postinfo);
    }
    // Public name of Author who last modified a post, since WordPress 2.8.
    // Check first if function is available (= if this is WP 2.8+)
    if (function_exists('the_modified_author')) {
        if (strpos($postinfo_string, '%modified-author%') !== FALSE) {
            ob_start();
            the_modified_author();
            $modified_author = ob_get_contents();
            ob_end_clean();
            $postinfo = str_replace("%modified-author%", $modified_author, $postinfo);
        }
    }
    // Author about yourself
    if (strpos($postinfo_string, '%author-description%') !== FALSE) {
        ob_start();
        the_author_meta('description');
        $author_description = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-description%", $author_description, $postinfo);
    }
    // Author login name
    if (strpos($postinfo_string, '%author-login%') !== FALSE) {
        ob_start();
        the_author_meta('user_login');
        $author_login = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-login%", $author_login, $postinfo);
    }
    // Author first name
    if (strpos($postinfo_string, '%author-firstname%') !== FALSE) {
        ob_start();
        the_author_meta('first_name');
        $author_firstname = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-firstname%", $author_firstname, $postinfo);
    }
    // Author last name
    if (strpos($postinfo_string, '%author-lastname%') !== FALSE) {
        ob_start();
        the_author_meta('last_name');
        $author_lastname = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-lastname%", $author_lastname, $postinfo);
    }
    // Author nickname
    if (strpos($postinfo_string, '%author-nickname%') !== FALSE) {
        ob_start();
        the_author_meta('nickname');
        $author_nickname = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-nickname%", $author_nickname, $postinfo);
    }
    // Author ID
    if (strpos($postinfo_string, '%author-id%') !== FALSE) {
        ob_start();
        the_author_meta('ID');
        $author_ID = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-id%", $author_ID, $postinfo);
    }
    // Author email address, clear text in HTML source code
    if (strpos($postinfo_string, '%author-email-clear%') !== FALSE) {
        ob_start();
        the_author_meta('email');
        $author_email_clear = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-email-clear%", $author_email_clear, $postinfo);
    }
    // Author email address obfuscated
    if (strpos($postinfo_string, '%author-email%') !== FALSE) {
        $postinfo = str_replace("%author-email%", antispambot(get_the_author_email()), $postinfo);
    }
    // Author website URL
    if (strpos($postinfo_string, '%author-url%') !== FALSE) {
        ob_start();
        the_author_meta('url');
        $author_url = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-url%", $author_url, $postinfo);
    }
    // Author website link
    if (strpos($postinfo_string, '%author-link%') !== FALSE) {
        ob_start();
        the_author_link();
        $author_link = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-link%", $author_link, $postinfo);
    }
    // Author posts archive link
    if (strpos($postinfo_string, '%author-posts-link%') !== FALSE) {
        ob_start();
        the_author_posts_link();
        $author_posts_link = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-posts-link%", $author_posts_link, $postinfo);
    }
    //  LEGACY: %author-linked% replaced by %author-posts-link% in 3.3.2, but displays the same: Author posts archive link
    if (strpos($postinfo_string, '%author-linked%') !== FALSE) {
        ob_start();
        the_author_posts_link();
        $author_posts_link = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-linked%", $author_posts_link, $postinfo);
    }
    // Author post count
    if (strpos($postinfo_string, '%author-post-count%') !== FALSE) {
        ob_start();
        the_author_posts();
        $author_post_count = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-post-count%", $author_post_count, $postinfo);
    }
    // Author AOL Instant Messenger screenname
    if (strpos($postinfo_string, '%author-aim%') !== FALSE) {
        ob_start();
        the_author_meta('aim');
        $author_aim = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-aim%", $author_aim, $postinfo);
    }
    // Author Yahoo IM ID
    if (strpos($postinfo_string, '%author-yim%') !== FALSE) {
        ob_start();
        the_author_meta('yim');
        $author_yim = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-yim%", $author_yim, $postinfo);
    }
    // Date & Time
    if (strpos($postinfo_string, '%date(') !== FALSE) {
        $postinfo = preg_replace_callback("/%date\\((.*?)'(.*?)'(.*?)\\)%/is", "bfa_parse_date_callback", $postinfo);
    }
    // Date & Time, last modified
    if (strpos($postinfo_string, '%date-modified(') !== FALSE) {
        $postinfo = preg_replace_callback("/%date-modified\\((.*?)'(.*?)'(.*?)\\)%/is", "bfa_parse_date_modified_callback", $postinfo);
    }
    // Tags, linked - since WP 2.3
    if (strpos($postinfo_string, '%tags-linked') !== FALSE) {
        while (strpos($postinfo, '%tags-linked') !== FALSE) {
            $tag_link_options = preg_match("/(.*)%tags-linked\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $tag_link_matches);
            $tags_linked = get_the_tag_list($tag_link_matches[2], $tag_link_matches[4], $tag_link_matches[6]);
            $postinfo = preg_replace("/(.*)%tags-linked\\((.*?)\\)%(.*)/i", "\${1}" . $tags_linked . "\${3}", $postinfo);
        }
    }
    // Tags, linked. If post has no tags, categories are displayed instead -  since WP 2.3
    if (strpos($postinfo_string, '%tags-cats-linked') !== FALSE) {
        while (strpos($postinfo, '%tags-cats-linked') !== FALSE) {
            $tag_link_options = preg_match("/(.*)%tags-cats-linked\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $tag_link_matches);
            ob_start();
            the_tags($tag_link_matches[2], $tag_link_matches[4], $tag_link_matches[6]);
            $tags_cats_linked = ob_get_contents();
            ob_end_clean();
            $postinfo = preg_replace("/(.*)%tags-cats-linked\\((.*?)\\)%(.*)/i", "\${1}" . $tags_cats_linked . "\${3}", $postinfo);
        }
    }
    // Tags, not linked - since WP 2.3
    if (strpos($postinfo_string, '%tags(') !== FALSE) {
        while (strpos($postinfo, '%tags(') !== FALSE) {
            $tag_options = preg_match("/(.*)%tags\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $tag_matches);
            $posttags = get_the_tags();
            if ($posttags) {
                foreach ($posttags as $tag) {
                    $tag_list .= $tag->name . $tag_matches[4];
                }
                // remove last separator
                $tag_list = preg_replace("/" . $tag_matches[4] . "\$/mi", "", $tag_list);
                $tags = $tag_matches[2] . $tag_list . $tag_matches[6];
            } else {
                $tags = "";
            }
            $postinfo = preg_replace("/(.*)%tags\\((.*?)\\)%(.*)/i", "\${1}" . $tags . "\${3}", $postinfo);
        }
    }
    // 1st category
    if (strpos($postinfo_string, '%category%') !== FALSE) {
        $all_categories = get_the_category();
        $category = $all_categories[0]->cat_name;
        $category_notlinked = $category;
        $postinfo = str_replace("%category%", $category_notlinked, $postinfo);
    }
    // 1st category, linked
    if (strpos($postinfo_string, '%category-linked%') !== FALSE) {
        $all_categories = get_the_category();
        $category = $all_categories[0]->cat_name;
        $category_linked = '<a class="' . $category . '" href="' . get_category_link($all_categories[0]->cat_ID) . '">' . $category . '</a>';
        $postinfo = str_replace("%category-linked%", $category_linked, $postinfo);
    }
    // Categories, linked with class name added
    $categories_linked = '';
    if (strpos($postinfo_string, '%categories-linked') !== FALSE) {
        while (strpos($postinfo, '%categories-linked') !== FALSE) {
            $category_linked_separator = preg_match("/(.*)%categories-linked\\('(.*?)'\\)(.*)/i", $postinfo_string, $category_linked_matches);
            ob_start();
            $categories = get_the_category();
            $items_in_categories = count($categories);
            $output = '';
            $categories_count = $items_in_categories;
            if ($categories) {
                foreach ($categories as $category) {
                    $categories_count -= 1;
                    if ($categories_count) {
                        $seperator = $category_linked_matches[2];
                    } else {
                        $seperator = '';
                    }
                    $categories_linked .= '<a class="' . $category->slug . '" href="' . get_category_link($category->term_id) . '" title="' . esc_attr(sprintf(__("View all posts in %s"), $category->name)) . '">' . $category->cat_name . $seperator . '</a>';
                }
            }
            ob_end_clean();
            $postinfo = preg_replace("/(.*)%categories-linked\\((.*?)\\)%(.*)/i", "\${1}" . $categories_linked . "\${3}", $postinfo);
        }
    }
    // Categories, not linked
    if (strpos($postinfo_string, '%categories(') !== FALSE) {
        while (strpos($postinfo, '%categories(') !== FALSE) {
            $category_separator = preg_match("/(.*)%categories\\('(.*?)'\\)(.*)/i", $postinfo_string, $category_matches);
            $categories = "";
            foreach (get_the_category() as $category) {
                $categories .= $category->cat_name . $category_matches[2];
            }
            // remove last separator
            $categories = preg_replace("/" . $category_matches[2] . "\$/mi", "", $categories);
            $postinfo = preg_replace("/(.*)%categories\\((.*?)\\)%(.*)/i", "\${1}" . $categories . "\${3}", $postinfo);
        }
    }
    // Comment link
    if (strpos($postinfo_string, '%comments(') !== FALSE) {
        while (strpos($postinfo, '%comments(') !== FALSE) {
            $comment_options = preg_match("/(.*)%comments\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $comment_matches);
            if (!comments_open() and $comment_matches[8] == "dontshow") {
                $comment_link = '';
            } else {
                ob_start();
                comments_popup_link($comment_matches[2], $comment_matches[4], $comment_matches[6], 'comments-link', $comment_matches[8]);
                $comment_link = ob_get_contents();
                ob_end_clean();
            }
            if (!comments_open()) {
                if ($post->comment_count == 0) {
                    $comment_link = '<strong>' . $comment_matches[8] . '</strong>';
                } else {
                    $comment_link = $comment_link . ' - <strong>(' . $comment_matches[8] . ')</strong>';
                }
            }
            if (!comments_open() and $comment_matches[8] == "dontshow") {
                $comment_link = '';
            }
            $postinfo = preg_replace("/(.*)%comments\\((.*?)\\)%(.*)/i", "\${1}" . $comment_link . "\${3}", $postinfo);
        }
    }
    // Comments Feed link
    if (strpos($postinfo_string, '%comments-rss') !== FALSE) {
        while (strpos($postinfo, '%comments-rss') !== FALSE) {
            $comments_rss_link_text = preg_match("/(.*)%comments-rss\\('(.*?)'(.*)/i", $postinfo_string, $comments_rss_matches);
            ob_start();
            post_comments_feed_link($comments_rss_matches[2]);
            $comments_rss_link = ob_get_contents();
            ob_end_clean();
            // make link nofollow if set in theme options
            if ($bfa_ata['nofollow'] == "Yes") {
                $comments_rss_link = str_replace('href=', 'rel="nofollow" href=', $comments_rss_link);
            }
            $postinfo = preg_replace("/(.*)%comments-rss\\((.*?)\\)%(.*)/i", "\${1}" . $comments_rss_link . "\${3}", $postinfo);
        }
    }
    // Trackback URL
    if (strpos($postinfo_string, '%trackback%') !== FALSE) {
        $trackback_url = trackback_url(FALSE);
        $postinfo = str_replace("%trackback%", $trackback_url, $postinfo);
    }
    // Trackback Link
    if (strpos($postinfo_string, '%trackback-linked(') !== FALSE) {
        while (strpos($postinfo, '%trackback-linked(') !== FALSE) {
            $trackback_url = trackback_url(FALSE);
            $trackback_link_text = preg_match("/(.*)%trackback-linked\\('(.*?)'(.*)/i", $postinfo_string, $trackback_matches);
            $trackback_link = '<a href="' . $trackback_url . '">' . $trackback_matches[2] . '</a>';
            // make link nofollow if set in theme options
            if ($bfa_ata['nofollow'] == "Yes") {
                $trackback_link = str_replace('href=', 'rel="nofollow" href=', $trackback_link);
            }
            $postinfo = preg_replace("/(.*)%trackback-linked\\((.*?)\\)%(.*)/i", "\${1}" . $trackback_link . "\${3}", $postinfo);
        }
    }
    // Trackback RDF
    if (strpos($postinfo_string, '%trackback-rdf%') !== FALSE) {
        ob_start();
        trackback_rdf();
        $trackback_rdf = "<!-- " . ob_get_contents() . " -->";
        ob_end_clean();
        $postinfo = str_replace("%trackback-rdf%", $trackback_rdf, $postinfo);
    }
    // Permalink
    if (strpos($postinfo_string, '%permalink%') !== FALSE) {
        ob_start();
        the_permalink();
        $permalink = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%permalink%", $permalink, $postinfo);
    }
    // Post ID
    if (strpos($postinfo_string, '%post-id%') !== FALSE) {
        ob_start();
        the_ID();
        $post_id = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%post-id%", $post_id, $postinfo);
    }
    // Post Title
    if (strpos($postinfo_string, '%post-title%') !== FALSE) {
        ob_start();
        the_title();
        $post_title = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%post-title%", $post_title, $postinfo);
    }
    // Edit post
    if (strpos($postinfo_string, '%edit(') !== FALSE) {
        while (strpos($postinfo, '%edit(') !== FALSE) {
            $edit_options = preg_match("/(.*)%edit\\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i", $postinfo_string, $edit_matches);
            ob_start();
            edit_post_link($edit_matches[4], $edit_matches[2], $edit_matches[6]);
            $edit_link = ob_get_contents();
            ob_end_clean();
            $postinfo = preg_replace("/(.*)%edit\\((.*?)\\)%(.*)/i", "\${1}" . $edit_link . "\${3}", $postinfo);
        }
    }
    // Print
    if (strpos($postinfo_string, '%print(') !== FALSE) {
        while (strpos($postinfo, '%print(') !== FALSE) {
            $print_text = preg_match("/(.*)%print\\('(.*?)'(.*)/i", $postinfo_string, $print_text_matches);
            $print_link = '<a href="javascript:window.print()">' . $print_text_matches[2] . '</a>';
            $postinfo = preg_replace("/(.*)%print\\((.*?)\\)%(.*)/i", "\${1}" . $print_link . "\${3}", $postinfo);
        }
    }
    // For the "WP-Email" plugin
    if (strpos($postinfo_string, '%wp-email%') !== FALSE) {
        $wp_email = function_exists('wp_email') ? email_link($email_post_text = '', $email_page_text = '', $echo = FALSE) : "";
        $postinfo = str_replace("%wp-email%", $wp_email, $postinfo);
    }
    // For the "WP-Print" plugin
    if (strpos($postinfo_string, '%wp-print%') !== FALSE) {
        $wp_print = function_exists('wp_print') ? print_link($print_post_text = '', $print_page_text = '', $echo = FALSE) : "";
        $postinfo = str_replace("%wp-print%", $wp_print, $postinfo);
    }
    // For the "WP-PostViews" plugin
    if (strpos($postinfo_string, '%wp-postviews%') !== FALSE) {
        $wp_postviews = function_exists('the_views') ? the_views($display = FALSE) : "";
        $postinfo = str_replace("%wp-postviews%", $wp_postviews, $postinfo);
    }
    // For the "WP-PostRatings" plugin
    if (strpos($postinfo_string, '%wp-postratings%') !== FALSE) {
        $wp_postratings = function_exists('the_ratings') ? the_ratings($start_tag = 'span', $custom_id = 0, $display = FALSE) : "";
        $postinfo = str_replace("%wp-postratings%", $wp_postratings, $postinfo);
    }
    // For the "Sociable" plugin
    if (strpos($postinfo_string, '%sociable%') !== FALSE) {
        ob_start();
        $sociable = (function_exists('sociable_html2') and function_exists(do_sociable())) ? do_sociable() : "";
        $sociable = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%sociable%", $sociable, $postinfo);
    }
    // For the "Share This" plugin
    if (strpos($postinfo_string, '%share-this%') !== FALSE) {
        ob_start();
        if (function_exists('sharethis_button')) {
            sharethis_button();
            $share_this = ob_get_contents();
        } else {
            $share_this = "";
        }
        ob_end_clean();
        $postinfo = str_replace("%share-this%", $share_this, $postinfo);
    }
    // Images
    if (strpos($postinfo_string, '<image(') !== FALSE) {
        $postinfo = preg_replace_callback("|<image\\((.*?)\\)>|", "bfa_image_files", $postinfo);
    }
    /* The meta = ALL custom fields:values, formatted by Wordpress as
    	unordered list <ul><li>..</li><li>..</li></ul> */
    if (strpos($postinfo_string, '%meta%') !== FALSE) {
        ob_start();
        the_meta();
        $the_meta = ob_get_contents();
        ob_end_clean();
        // 3.4.3.: remove bfa_ata metas */
        $the_meta = preg_replace("/<li>(.*)bfa_ata(.*)<\\/li>/i", "", $the_meta);
        $postinfo = str_replace("%meta%", $the_meta, $postinfo);
    }
    // Single post meta values, not formatted
    if (strpos($postinfo_string, '%meta(') !== FALSE) {
        $postinfo = preg_replace_callback("|%meta\\('(.*?)'\\)%|", "bfa_meta_value", $postinfo);
    }
    // Since 3.6.7, parse widget areas
    $postinfo = bfa_parse_widget_areas($postinfo);
    return $postinfo;
}
Exemplo n.º 17
0
    function ht_author_bio()
    {
        ?>
    <div id="author-info">
        <div class="border-style">
            <div class="inner"><span class="fl"><?php 
        echo get_avatar(get_the_author_meta('email'), '60');
        ?>
</span>
                <p>
                    <strong class="author-name">
                        <?php 
        the_author_link();
        ?>
                    </strong>
                    <?php 
        if (get_the_author_meta('description') == '') {
            echo __('The author didn\'t add any Information to his profile yet. ', 'highthemes');
        } else {
            the_author_meta('description');
        }
        ?>
                </p>
                <div class="fix"></div>
            </div>
        </div>
    </div>
        <?php 
    }
Exemplo n.º 18
0
function pego_get_author_data($post)
{
    ?>
	<!--BEGIN .author-bio-->
	<div class="clear"></div>
	<div class="author-bio">
				<?php 
    echo get_avatar(get_the_author_meta('email'), '90');
    ?>
	<div class="author-info">
	<ul class="author-socials">
		<?php 
    if (get_the_author_meta('user_url', $post->post_author) != '') {
        echo '<li><a title="WebSite" href="' . get_the_author_meta('user_url', $post->post_author) . '" class="icons-author-socials icon-home"></a></li>';
    }
    if (get_the_author_meta('facebook', $post->post_author) != '') {
        echo '<li><a title="Facebook" href="' . get_the_author_meta('facebook', $post->post_author) . '" class="icons-author-socials icon-facebook"></a></li>';
    }
    if (get_the_author_meta('twitter', $post->post_author) != '') {
        echo '<li><a title="Twitter"  href="' . get_the_author_meta('twitter', $post->post_author) . '" class="icons-author-socials icon-twitter"></a></li>';
    }
    if (get_the_author_meta('googleplus', $post->post_author) != '') {
        echo '<li><a title="Google Plus" href="' . get_the_author_meta('googleplus', $post->post_author) . '" class="icons-author-socials icon-gplus"></a></li>';
    }
    if (get_the_author_meta('linkedin', $post->post_author) != '') {
        echo '<li><a title="LinkedIn" href="' . get_the_author_meta('linkedin', $post->post_author) . '" class="icons-author-socials icon-linkedin"></a></li>';
    }
    if (get_the_author_meta('mail', $post->post_author) != '') {
        echo '<li><a title="Mail" href="' . get_the_author_meta('mail', $post->post_author) . '" class="icons-author-socials icon-mail"></a></li>';
    }
    ?>
	</ul>
	
	<h3 class="author-title">
	<?php 
    if (function_exists('ot_get_option')) {
        if (ot_get_option('meganews_written_by_caption') != '') {
            echo ot_get_option('meganews_written_by_caption') . ' ';
        }
    }
    the_author_link();
    ?>
</h3>
	<p class="author-description"><?php 
    the_author_meta('description');
    ?>
	</div>
	<!--END .author-bio-->
	<div class="clear"></div>
	</div>
	<div class="clear"></div>
	<?php 
}
Exemplo n.º 19
0
    the_link();
    ?>
"><?php 
    the_title();
    ?>
</a></h4>
	<div class="entry">
	<div class="content">
		<?php 
    the_content();
    ?>
	</div>

<p class="date">
<?php 
    the_author_link('before=by &after= at ');
    ?>
<a href="<?php 
    the_link();
    ?>
"><?php 
    the_time('format=F d, Y h:i A');
    ?>
</a><!--<TMPL_IF category> under <TMPL_VAR category></TMPL_IF>-->
</p>
</div>
</div>
<?php 
    $notfirst = true;
}
?>
Exemplo n.º 20
0
/**
 * Displays the modified list of popular posts.
 **/
function padd_theme_widget_popular_posts($limit = 5, $range = 'all', $order_by = 'comment_count')
{
    global $wpdb;
    $table = $wpdb->prefix . "popularpostsdata";
    $nopages = "AND {$wpdb->posts}.post_type = 'post'";
    // Range options
    switch ($range) {
        case 'all':
            $range = "post_date_gmt < '" . gmdate("Y-m-d H:i:s") . "'";
            break;
        case 'yesterday':
            $range = $table . "cache.day >= '" . gmdate("Y-m-d") . "' - INTERVAL 1 DAY";
            break;
        case 'daily':
            $range = $table . "cache.day = CURDATE()";
            break;
        case 'weekly':
            $range = $table . "cache.day >= '" . gmdate("Y-m-d") . "' - INTERVAL 7 DAY";
            break;
        case 'monthly':
            $range = $table . "cache.day >= '" . gmdate("Y-m-d") . "' - INTERVAL 30 DAY";
            break;
        default:
            $range = "post_date_gmt < '" . gmdate("Y-m-d H:i:s") . "'";
            break;
    }
    // Sorting options
    switch ($instance['order_by']) {
        case 'comments':
            $sortby = 'comment_count';
            break;
        case 'views':
            $sortby = 'pageviews';
            break;
        case 'avg':
            $sortby = 'avg_views';
            break;
        default:
            $sortby = 'comment_count';
            break;
    }
    if ($instance['range'] == 'all') {
        $join = "LEFT JOIN {$table} ON {$wpdb->posts}.ID = {$table}.postid ";
        $force_pv = "AND " . $table . ".pageviews > 0 ";
    } else {
        $join = "RIGHT JOIN " . $table . "cache ON {$wpdb->posts}.ID = " . $table . "cache.id ";
        $force_pv = "";
    }
    $fields .= ", {$wpdb->posts}.comment_count AS 'comment_count' ";
    $mostpopular = $wpdb->get_results("SELECT {$wpdb->posts}.ID, {$wpdb->posts}.post_title {$fields} FROM {$wpdb->posts} {$join} WHERE {$wpdb->posts}.post_status = 'publish' AND {$wpdb->posts}.post_password = '' AND {$range} {$force_pv} {$nopages} {$exclude} GROUP BY {$wpdb->posts}.ID ORDER BY {$sortby} DESC LIMIT " . $limit . "");
    if (!is_array($mostpopular) || empty($mostpopular)) {
        echo '<p>' . __('Sorry. No data so far.', 'wordpress-popular-posts') . '</p>';
    } else {
        foreach ($mostpopular as $post) {
            $comments = '';
            $count = (int) $post->comment_count;
            if ($count > 1) {
                $comments = $count . ' comments';
            } else {
                if ($count == 1) {
                    $comments = '1 comment';
                } else {
                    $comments = 'no comments';
                }
            }
            ?>
	
			<div class="popular-post">
				<h3><a href="<?php 
            echo get_permalink($post->ID);
            ?>
 " title="Permalink to <?php 
            echo $post->post_title;
            ?>
"><?php 
            echo $post->post_title;
            ?>
</a></h3>
				<div class="meta">
					<p>
						<span class="author">Posted by <?php 
            the_author_link();
            ?>
</span> -
						<span class="comments"><a href="<?php 
            echo get_comments_link($post->ID);
            ?>
 "><?php 
            echo $comments;
            ?>
</a></span>
					</p>
				</div>
			</div>
		<?php 
        }
    }
}
Exemplo n.º 21
0
    function blog_meta()
    {
        global $post;
        if (theme_get_option('blog', 'meta_comment') && ($post->comment_count > 0 || comments_open())) {
            ?>
			<span class="comments"><?php 
            comments_popup_link(__('No Comments', 'striking_front'), __('1 Comment', 'striking_front'), __('% Comments', 'striking_front'), '');
            ?>
</span>
<?php 
        }
        if (theme_get_option('blog', 'meta_category')) {
            ?>
			<span class="categories"><?php 
            _e('Posted in: ', 'striking_front');
            the_category(', ');
            ?>
</span>
			<span class="separater">|</span>
<?php 
        }
        if (theme_get_option('blog', 'meta_tags')) {
            ?>
			<?php 
            the_tags('<span class="tags">' . __('Tags: ', 'striking_front'), ', ', '</span> <span class="separater">|</span>');
        }
        if (theme_get_option('blog', 'meta_author')) {
            ?>
			<span class="author"><?php 
            _e('By: ', 'striking_front');
            the_author_link();
            ?>
</span>
			<span class="separater">|</span>
<?php 
        }
        if (theme_get_option('blog', 'meta_date')) {
            ?>
			<time datetime="<?php 
            the_time('Y-m-d');
            ?>
"><a href="<?php 
            echo get_month_link(get_the_time('Y'), get_the_time('m'));
            ?>
"><?php 
            echo get_the_date();
            ?>
</a></time>
<?php 
        }
        edit_post_link(__('Edit', 'striking_front'), '<span class="separater">|</span> <span class="edit-link">', '</span>');
    }
Exemplo n.º 22
0
    public function widget($args, $instance)
    {
        //36587312
        extract($args);
        extract($instance);
        ?>
		<?php 
        echo $before_widget;
        ?>

		<?php 
        global $data, $post;
        extract($args);
        $posts = $instance['posts'];
        $comments = $instance['comments'];
        $tags_count = $instance['tags'];
        $show_popular_posts = isset($instance['show_popular_posts']) ? 'true' : 'false';
        $show_recent_posts = isset($instance['show_recent_posts']) ? 'true' : 'false';
        $show_comments = isset($instance['show_comments']) ? 'true' : 'false';
        $show_tags = isset($instance['show_tags']) ? 'true' : 'false';
        if (isset($instance['orderby'])) {
            $orderby = $instance['orderby'];
        } else {
            $orderby = 'Highest Comments';
        }
        ?>
		<div class="widget-tabs">
			<div class="tab-hold tabs-wrapper">
				<ul id="tabs" class="tabset tabs">
					<?php 
        if ($show_popular_posts == 'true') {
            ?>
					<li><a href="#tab-popular">Popular</a></li>
					<?php 
        }
        ?>
					<?php 
        if ($show_recent_posts == 'true') {
            ?>
					<li><a href="#tab-recent">Recent</a></li>
					<?php 
        }
        ?>
					<?php 
        if ($show_comments == 'true') {
            ?>
					<li><a href="#tab-comments">Comments</a></li>
					<?php 
        }
        ?>
				</ul>
				<div class="tab-box tabs-container">
					<?php 
        if ($show_popular_posts == 'true') {
            ?>
					<div id="tab-popular" class="tab tab_content" style="display: none;">
						<?php 
            if ($orderby == 'Highest Comments') {
                $order_string = '&orderby=comment_count';
            } else {
                $order_string = '&meta_key=webnus_views&orderby=meta_value_num';
            }
            $popular_posts = new WP_Query('showposts=' . $posts . $order_string . '&order=DESC');
            if ($popular_posts->have_posts()) {
                ?>
						<ul class="tab-list">
							<?php 
                while ($popular_posts->have_posts()) {
                    $popular_posts->the_post();
                    ?>
							<li>
								<?php 
                    if (has_post_thumbnail()) {
                        ?>
								<div class="image">
									<a href="<?php 
                        the_permalink();
                        ?>
">
										<?php 
                        the_post_thumbnail('tabs-img');
                        ?>
									</a>
								</div>
								<?php 
                    }
                    ?>
								<div class="content">
									<a class="tab-title" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a>
									<div class="tab-meta"><strong><?php 
                    _e('by ', 'WEBNUS_TEXT_DOMAIN');
                    ?>
</strong><?php 
                    the_author_link();
                    ?>
 <strong><?php 
                    _e('in ', 'WEBNUS_TEXT_DOMAIN');
                    ?>
</strong><?php 
                    the_category(' / ');
                    ?>
</div>
									<div class="tab-meta">
										<span class="tab-date"><i class="fa-clock-o"></i> <?php 
                    the_time('d M y');
                    ?>
</span>	
										<span class="tab-views"> <i class="fa-eye"></i> <?php 
                    echo getViews(get_the_ID());
                    ?>
</span>
										<span class="tab-comments"> <i class="fa-comment-o"></i> <?php 
                    comments_number('0', '1', '%');
                    ?>
 </span>
									</div>
								</div>
							</li>
							<?php 
                }
                ?>
						</ul>
						<?php 
            }
            ?>
					</div>
					<?php 
        }
        ?>
					<?php 
        if ($show_recent_posts == 'true') {
            ?>
					<div id="tab-recent" class="tab tab_content" style="display: none;">
						<?php 
            $recent_posts = new WP_Query('showposts=' . $tags_count);
            if ($recent_posts->have_posts()) {
                ?>
						<ul class="tab-list">
							<?php 
                while ($recent_posts->have_posts()) {
                    $recent_posts->the_post();
                    ?>
							<li>
								<?php 
                    if (has_post_thumbnail()) {
                        ?>
								<div class="image">
									<a href="<?php 
                        the_permalink();
                        ?>
">
										<?php 
                        the_post_thumbnail('tabs-img');
                        ?>
									</a>
								</div>
								<?php 
                    }
                    ?>
								<div class="content">
									<a class="tab-title" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a>
									<div class="tab-meta"><strong><?php 
                    _e('by ', 'WEBNUS_TEXT_DOMAIN');
                    ?>
</strong><?php 
                    the_author_link();
                    ?>
 <strong><?php 
                    _e('in ', 'WEBNUS_TEXT_DOMAIN');
                    ?>
</strong><?php 
                    the_category(' / ');
                    ?>
</div>
									<div class="tab-meta">
										<span class="tab-date"><i class="fa-clock-o"></i> <?php 
                    the_time('d M y');
                    ?>
</span>	
										<span class="tab-views"> <i class="fa-eye"></i> <?php 
                    echo getViews(get_the_ID());
                    ?>
</span>
										<span class="tab-comments"> <i class="fa-comment-o"></i> <?php 
                    comments_number('0', '1', '%');
                    ?>
 </span>
									</div>
								</div>
							</li>
							<?php 
                }
                ?>
						</ul>
						<?php 
            }
            ?>
					</div>
					<?php 
        }
        ?>
					<?php 
        if ($show_comments == 'true') {
            ?>
					<div id="tab-comments" class="tab tab_content" style="display: none;">
						<ul class="tab-list">
							<?php 
            $number = $instance['comments'];
            global $wpdb;
            $recent_comments = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved, comment_type, comment_author_url, SUBSTRING(comment_content,1,210) AS com_excerpt FROM {$wpdb->comments} LEFT OUTER JOIN {$wpdb->posts} ON ({$wpdb->comments}.comment_post_ID = {$wpdb->posts}.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT {$number}";
            $the_comments = $wpdb->get_results($recent_comments);
            foreach ($the_comments as $comment) {
                ?>
							<li>
								<div class="image">
									<a>
										<?php 
                echo get_avatar($comment, '80');
                ?>
									</a>
								</div>
								<div class="content">
									<p><?php 
                echo strip_tags($comment->comment_author);
                ?>
 says:</p>
									<div>
										<a class="comment-text-side" href="<?php 
                echo get_permalink($comment->ID);
                ?>
#comment-<?php 
                echo $comment->comment_ID;
                ?>
" title="<?php 
                echo strip_tags($comment->comment_author);
                ?>
 on <?php 
                echo $comment->post_title;
                ?>
"><?php 
                echo strip_tags($comment->com_excerpt);
                ?>
...</a>
									</div>
								</div>
							</li>
							<?php 
            }
            ?>
						</ul>
					</div>
					<?php 
        }
        ?>
				</div>
			</div>
		</div>
		
		<?php 
        echo $after_widget;
        ?>
<!-- Disclaimer -->
		<?php 
    }
Exemplo n.º 23
0
            the_title();
        } else {
            _e('No title', 'diversity');
        }
        ?>
</a></h2>

		<div class="entry-date">
			<span class="fa fa-calendar"></span> <?php 
        the_time('j F Y');
        ?>
 / 
		</div>
		<div class="entry-author">
			<span class="fa fa-user"></span> <?php 
        the_author_link();
        ?>
 / 
		</div>
		<div class="entry-cat">
			<span class="fa fa-bars"></span> <?php 
        the_category(', ');
        ?>
 
		</div>
		<div class="clear"></div>
		<div class="single-post-image">
			<a href="<?php 
        the_permalink();
        ?>
"><?php 
    function widget($args, $instance)
    {
        global $post;
        $cache = wp_cache_get('widget_latest_posts_entries', 'widget');
        if (!is_array($cache)) {
            $cache = array();
        }
        if (!isset($args['widget_id'])) {
            $args['widget_id'] = $this->id;
        }
        if (isset($cache[$args['widget_id']])) {
            echo $cache[$args['widget_id']];
            return;
        }
        ob_start();
        extract($args);
        echo $before_widget;
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Popular Posts', "framework") : $instance['title'], $instance, $this->id_base);
        if (empty($instance['number']) || !($number = absint($instance['number']))) {
            $number = 10;
        }
        $r = new WP_Query(apply_filters('widget_posts_args', array('orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true)));
        if ($r->have_posts()) {
            ?>
			<?php 
            echo $before_title . $title . $after_title;
            ?>
			<?php 
            $posts_sz = count($r->posts);
            ?>
			<?php 
            $i = 1;
            ?>
			<ul class="latest-posts">
				<?php 
            while ($r->have_posts()) {
                $r->the_post();
                ?>
				<li>
					<div class="latest-desc">
						<div class="latest-meta">
							<div class="latest-date"><?php 
                the_time(get_option('date_format'));
                ?>
</div>
							<div class="latest-author"><?php 
                _e('By', 'circles');
                ?>
 <?php 
                the_author_link();
                ?>
</div>
						</div>
						<h3><a title="<?php 
                echo esc_attr(get_the_title() ? get_the_title() : get_the_ID());
                ?>
" href="<?php 
                the_permalink();
                ?>
"><?php 
                if (get_the_title()) {
                    echo ts_get_shortened_string(get_the_title(), 6);
                } else {
                    the_ID();
                }
                ?>
</a></h3>
						<div class="latest-excerpts"><?php 
                ts_the_excerpt_theme('tiny');
                ?>
</div>
					</div>
					<div class="clear"></div>
				</li>
				<?php 
                $i++;
                ?>
				<?php 
            }
            ?>
			</ul>
			<?php 
            // Reset the global $the_post as this query will have stomped on it
            wp_reset_postdata();
        }
        //have_posts()
        echo $after_widget;
        $cache[$args['widget_id']] = ob_get_flush();
        wp_cache_set('widget_latest_posts_entries', $cache, 'widget');
    }