Example #1
1
/**
 * Post meta for above the post.
 */
function restful_post_meta_above()
{
    global $post;
    ?>

  <div class="entry__meta-item">
    <i class="fa fa-calendar"></i>
    <a href="<?php 
    esc_url(get_permalink());
    ?>
"><?php 
    the_time(get_option('date_format'));
    ?>
</a>
  </div>

  <div class="entry__meta-item">
    <i class="fa fa-user"></i>
    <a href="<?php 
    echo esc_url(get_author_posts_url($post->post_author));
    ?>
"><?php 
    the_author_meta('display_name', $post->post_author);
    ?>
</a>
  </div>

  <?php 
    if (comments_open() || have_comments()) {
        ?>
    <div class="entry__meta-item">
      <i class="fa fa-comment"></i>
      <a href="<?php 
        esc_url(comments_link());
        ?>
"><?php 
        comments_number();
        ?>
</a>
    </div>
  <?php 
    }
    ?>

<?php 
}
    function formatAttribute()
    {
        global $post;
        ?>
        <ul class="post-in">
            <li>
                <?php 
        esc_html_e("Posted In  : ", "charity");
        the_category(" , ");
        $tags = get_tags();
        if (!empty($tags)) {
            the_tags(" , ");
        }
        ?>
            </li>
            <li>
                <a href="<?php 
        comments_link();
        ?>
"><?php 
        comments_number('0 : comment', '1 : comment', '% : comments');
        ?>
</a>
            </li>
        </ul>
        <?php 
    }
        function widget($args, $instance)
        {
            extract($args);
            $title = apply_filters('widget_title', $instance['title']);
            echo $before_widget;
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            ?>

		    	<ul class="post-list">
			    	<?php 
            query_posts('post_type=post&posts_per_page=' . $instance['amount'] . '&orderby=comment_count&order=DESC');
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    ?>
			    	
			    	<li>
			    		<figure class="frame pull-left">
			    		  <div class="icon-overlay"><a href="<?php 
                    the_permalink();
                    ?>
"><span class="icn-more"></span><?php 
                    the_post_thumbnail('thumbnail');
                    ?>
 </a></div>
			    		</figure>
			    		<div class="meta"> <em><span class="date"><?php 
                    the_time(get_option('date_format'));
                    ?>
 </span>
			    		<span class="comments"><a href="<?php 
                    comments_link();
                    ?>
"><?php 
                    comments_number('0', '1', '%');
                    ?>
 <i class="icon-chat-1"></i></a></span></em>
			    		  <h5><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h5>
			    		</div>
			    	</li>
			    	              
			    	<?php 
                }
            }
            wp_reset_query();
            ?>
		    	</ul>
			
			<?php 
            echo $after_widget;
        }
function comments_popup_link($zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $CSSclass = '', $none = 'Comments Off')
{
    global $wp_post_id, $wpcommentspopupfile, $wpcommentsjavascript, $post, $wpdb, $cookiehash, $wp_id;
    global $siteurl, $wp_mod;
    global $comment_count_cache;
    if (get_xoops_option($wp_mod[$wp_id], 'wp_use_xoops_comments') == 0) {
        if ('' == $comment_count_cache[$wp_id]["{$wp_post_id}"]) {
            $number = $wpdb->get_var("SELECT COUNT(comment_ID) FROM {$wpdb->comments[$wp_id]} WHERE comment_post_ID = {$wp_post_id} AND comment_approved = '1';");
        } else {
            $number = $comment_count_cache[$wp_id]["{$wp_post_id}"];
        }
    } else {
        $number = $wpdb->get_var("SELECT COUNT(comment_ID) FROM {$wpdb->comments[$wp_id]} WHERE comment_post_ID = {$wp_post_id} AND comment_approved = '1' AND (comment_content like '<trackback />%' OR comment_content like '<pingkback />%');");
    }
    if (0 == $number && 'closed' == $post->comment_status && 'closed' == $post->ping_status) {
        echo $none;
        return;
    } else {
        if (!empty($post->post_password)) {
            // if there's a password
            if ($_COOKIE['wp-postpass_' . $cookiehash] != $post->post_password) {
                // and it doesn't match the cookie
                echo "Enter your password to view comments";
                return;
            }
        }
        echo '<a href="';
        if ($wpcommentsjavascript) {
            echo $siteurl . '/' . $wpcommentspopupfile . '?p=' . $wp_post_id . '&amp;c=1';
            //echo get_permalink();
            echo '" onclick="wpopen(this.href); return false"';
        } else {
            // if comments_popup_script() is not in the template, display simple comment link
            comments_link();
            echo '"';
        }
        if (!empty($CSSclass)) {
            echo ' class="' . $CSSclass . '"';
        }
        echo '>';
        comments_number($zero, $one, $more, $number);
        echo '</a>';
    }
}
Example #5
0
function mom_news_boxes($atts, $content = null)
{
    global $unique_posts;
    global $do_unique_posts;
    extract(shortcode_atts(array('style' => 'nb1', 'title' => '', 'display' => '', 'cat' => '', 'tag' => '', 'number_of_posts' => '4', 'orderby' => '', 'order' => '', 'nb_excerpt' => '', 'sub_categories' => 'no', 'show_more' => 'yes', 'show_more_event' => '', 'post_type' => '', 'exclude_posts' => '', 'class' => ''), $atts));
    global $post;
    $exclude_posts = array($post->ID);
    $ajax_class = '';
    if ($show_more_event == 'ajax') {
        $ajax_class = 'show_more_ajax';
    }
    if ($style == 'nb6' && $number_of_posts == '4') {
        $number_of_posts = '3';
    }
    static $id = 75;
    $id++;
    if ($cat == 'Select a Category') {
        $cat = '';
    }
    if ($tag == 'Select a Tag') {
        $tag = '';
    }
    $head_colors = '';
    $head_class = '';
    if ($display == 'category' && mom_option('nb_skin') == 'color') {
        $cat_color = get_option("category_" . $cat);
        $cat_color = isset($cat_color['color']) ? $cat_color['color'] : '';
        if ($cat_color) {
            $head_colors .= 'style="';
            $head_colors .= 'background-color:' . $cat_color . ';';
            $head_colors .= '"';
            $head_class = 'colorful-box';
        }
    }
    $output = get_transient('mom_news_boxes_' . $id . $style . $display . $cat . $tag . $orderby . $show_more_event . $post_type);
    if ($orderby == 'rand') {
        $output = false;
    }
    $output = false;
    if ($output == false) {
        ob_start();
        $dateformat = mom_option('date_format');
        global $wpdb;
        $tag_ID = $wpdb->get_var("SELECT * FROM " . $wpdb->terms . " WHERE `name` = '" . $tag . "'");
        if ($display == 'category') {
            if ($title == '') {
                $nb_title = get_cat_name($cat);
            } else {
                $nb_title = $title;
            }
            $nb_link = get_category_link($cat);
        } elseif ($display == 'tag') {
            if ($title == '') {
                $nb_title = $tag;
            } else {
                $nb_title = $title;
            }
            $nb_link = get_tag_link($tag_ID);
        } else {
            $nb_title = $title;
            $nb_link = '#';
        }
        $sm_Atts = 'data-display="' . $display . '" data-nbs="' . $style . '" data-number_of_posts="' . $number_of_posts . '" data-cat_id="' . $cat . '" data-nb_excerpt="' . $nb_excerpt . '" data-tag="' . $tag . '"';
        $post_meta_hp = mom_option('post_meta_hp');
        /*
        if ($post_meta_hp === null) {
        			$post_meta_hp = 1;
        		}
        */
        if ($post_meta_hp == 1) {
            $post_head = mom_option('post_head');
            $post_head_author = mom_option('post_head_author');
            $post_head_date = mom_option('post_head_date');
            $post_head_cat = mom_option('post_head_cat');
            $post_head_commetns = mom_option('post_head_commetns');
            $post_head_views = mom_option('post_head_views');
        } else {
            $post_head = 1;
            $post_head_author = 1;
            $post_head_date = 1;
            $post_head_cat = 1;
            $post_head_commetns = 1;
            $post_head_views = 1;
        }
        ?>
                    
            <?php 
        if ($style == 'nb2') {
            ?>
                    
                    <section class="section news-box <?php 
            if ($display == 'category') {
                ?>
cat_<?php 
                echo $cat;
            }
            ?>
 <?php 
            echo $class;
            ?>
"><!--News box 2-->
                                
                        <header class="block-title <?php 
            echo $head_class;
            ?>
" <?php 
            echo $head_colors;
            ?>
>
                            <h2><a href="<?php 
            echo $nb_link;
            ?>
"><?php 
            echo $nb_title;
            ?>
</a></h2>
				<?php 
            mom_nb_head($style, $cat, $display, $number_of_posts, $sub_categories, $orderby, $nb_excerpt);
            ?>
                        </header>
                        
                        <div class="nb2">
                            <?php 
            if ($display == 'category') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tag') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            }
            update_post_thumbnail_cache($query);
            if ($query->have_posts()) {
                while ($query->have_posts()) {
                    $query->the_post();
                    if ($unique_posts) {
                        $do_unique_posts[] = get_the_ID();
                    }
                    ?>
                            <div <?php 
                    post_class('first-item');
                    ?>
 role="article" itemscope="" itemtype="http://schema.org/Article">
                                <?php 
                    if (mom_post_image() != false) {
                        ?>
                                <figure class="post-thumbnail"><a href="<?php 
                        the_permalink();
                        ?>
">
                                    <?php 
                        mom_post_image_full('nb1-thumb');
                        ?>
                                    <span class="post-format-icon"></span>
                                </a></figure>
                                <?php 
                    }
                    ?>
                                
                                <?php 
                    if (mom_post_image() != false) {
                        $mom_class = ' class="fix-right-content"';
                    } else {
                        $mom_class = '';
                    }
                    ?>
                                <div<?php 
                    echo $mom_class;
                    ?>
>
                                	<?php 
                    if ($post_head != 0) {
                        ?>
	                                <div class="entry-meta">
	                                <?php 
                        if ($post_head_date != 0) {
                            ?>
	                                    <time class="entry-date" datetime="<?php 
                            the_time('c');
                            ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                            mom_date_format();
                            ?>
</time>
	                                    <?php 
                        }
                        ?>
	                                    <?php 
                        if ($post_head_commetns != 0) {
                            ?>
	                                    <div class="comments-link">
	                                        <i class="momizat-icon-bubbles4"></i><a href="<?php 
                            comments_link();
                            ?>
"><?php 
                            comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                            ?>
</a>
	                                    </div>
	                                    <?php 
                        }
                        ?>
	                                </div>
	                                <?php 
                    }
                    ?>
	                                <h2 itemprop="name"><a itemprop="url" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
	                                <div class="entry-content">
	                                <?php 
                    if ($nb_excerpt != '0') {
                        ?>
  
	                                    <p>
	                                        <?php 
                        global $post;
                        $excerpt = $post->post_excerpt;
                        if ($excerpt == '') {
                            $excerpt = get_the_content('');
                        }
                        if ($nb_excerpt == '') {
                            echo wp_html_excerpt(strip_shortcodes($excerpt), 145, '...');
                        } else {
                            echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...');
                        }
                        ?>
	                                    </p>
	                                <?php 
                    }
                    ?>
	                                </div>
                                </div>
                            </div>
                            <?php 
                }
            } else {
            }
            wp_reset_postdata();
            ?>
                            
                            <ul>
                                <?php 
            if ($display == 'category') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tag') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            }
            update_post_thumbnail_cache($query);
            if ($query->have_posts()) {
                while ($query->have_posts()) {
                    $query->the_post();
                    if ($unique_posts) {
                        $do_unique_posts[] = get_the_ID();
                    }
                    ?>
                                <li role="article" itemscope="" itemtype="http://schema.org/Article">
                                    <h2 itemprop="name"><a itemprop="url" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
                                    <?php 
                    if ($post_head != 0) {
                        ?>
                                    <div class="entry-meta">
                                    	<?php 
                        if ($post_head_date != 0) {
                            ?>
                                        <time class="entry-date" datetime="<?php 
                            the_time('c');
                            ?>
" itemprop="dateCreated"><?php 
                            mom_date_format();
                            ?>
</time>
                                        <?php 
                        }
                        ?>
                                        <?php 
                        if ($post_head_commetns != 0) {
                            ?>
                                        <div class="comments-link">
                                            <a href="<?php 
                            comments_link();
                            ?>
"><?php 
                            comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                            ?>
</a>
                                        </div>
                                        <?php 
                        }
                        ?>
                                    </div>
                                    <?php 
                    }
                    ?>
                                </li>
                                <?php 
                }
            } else {
            }
            wp_reset_postdata();
            ?>
                            </ul>
                        </div>
			
                            <?php 
            if ($show_more != 'no') {
                ?>
			<footer class="newb2 show-more <?php 
                echo $ajax_class;
                ?>
" <?php 
                echo $sm_Atts;
                ?>
>
                                <a href="<?php 
                echo $nb_link;
                ?>
" data-post_type="<?php 
                echo $post_type;
                ?>
" data-offset="<?php 
                echo absint($number_of_posts + 1);
                ?>
" data-orig-offset="<?php 
                echo absint($number_of_posts + 1);
                ?>
"><?php 
                _e('Show More News', 'framework');
                ?>
</a>
                        </footer>
			<?php 
            }
            ?>
                        
                    </section><!--News box 2-->
            
            <?php 
        } elseif ($style == 'nb3') {
            ?>
            
                    <section class="section news-box <?php 
            if ($display == 'category') {
                ?>
cat_<?php 
                echo $cat;
            }
            ?>
 <?php 
            echo $class;
            ?>
"><!--News box 3-->
                                
                        <header class="block-title <?php 
            echo $head_class;
            ?>
" <?php 
            echo $head_colors;
            ?>
>
                            <h2><a href="<?php 
            echo $nb_link;
            ?>
"><?php 
            echo $nb_title;
            ?>
</a></h2>
				<?php 
            mom_nb_head($style, $cat, $display, $number_of_posts, $sub_categories, $orderby, $nb_excerpt);
            ?>
                        </header>
                        
                        <div class="nb3">
                            <?php 
            if ($display == 'category') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => 2, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tag') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => 2, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => 2, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            }
            update_post_thumbnail_cache($query);
            if ($query->have_posts()) {
                while ($query->have_posts()) {
                    $query->the_post();
                    if ($unique_posts) {
                        $do_unique_posts[] = get_the_ID();
                    }
                    ?>
                            <div <?php 
                    post_class('first-item');
                    ?>
 role="article" itemscope="" itemtype="http://schema.org/Article">
                                <?php 
                    if (mom_post_image() != false) {
                        ?>
                                <figure class="post-thumbnail"><a href="<?php 
                        the_permalink();
                        ?>
">
                                    <?php 
                        mom_post_image_full('nb1-thumb');
                        ?>
                                    <span class="post-format-icon"></span>
                                </a></figure>
                                <?php 
                    }
                    ?>
                                <?php 
                    if (mom_post_image() != false) {
                        $mom_class = ' class="fix-right-content"';
                    } else {
                        $mom_class = '';
                    }
                    ?>
                                <div<?php 
                    echo $mom_class;
                    ?>
>
                                <h2 itemprop="name"><a itemprop="url" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
                                <div class="entry-content">
                                <?php 
                    if ($nb_excerpt != '0') {
                        ?>
  
                                    <p>
	                                        <?php 
                        global $post;
                        $excerpt = $post->post_excerpt;
                        if ($excerpt == '') {
                            $excerpt = get_the_content('');
                        }
                        if ($nb_excerpt == '') {
                            echo wp_html_excerpt(strip_shortcodes($excerpt), 115, '...');
                        } else {
                            echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...');
                        }
                        ?>
	                                    </p>
	                            <?php 
                    }
                    ?>
                                </div>
                                <?php 
                    if ($post_head != 0) {
                        ?>
                                <div class="entry-meta">
                                	<?php 
                        if ($post_head_date != 0) {
                            ?>
                                    <time class="entry-date" datetime="<?php 
                            the_time('c');
                            ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                            mom_date_format();
                            ?>
</time>
                                    <?php 
                        }
                        ?>
                                    <?php 
                        if ($post_head_commetns != 0) {
                            ?>
                                    <div class="comments-link">
                                        <i class="momizat-icon-bubbles4"></i><a href="<?php 
                            comments_link();
                            ?>
"><?php 
                            comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                            ?>
</a>
                                    </div>
                                    <?php 
                        }
                        ?>
                                </div>
                                <?php 
                    }
                    ?>
                                </div>
                            </div>
                            <?php 
                }
            } else {
            }
            wp_reset_postdata();
            ?>
                            
                            <ul>
                                <?php 
            if ($display == 'category') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => 2, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tag') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'offset' => 2, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => $number_of_posts, 'offset' => 2, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            }
            update_post_thumbnail_cache($query);
            if ($query->have_posts()) {
                while ($query->have_posts()) {
                    $query->the_post();
                    if ($unique_posts) {
                        $do_unique_posts[] = get_the_ID();
                    }
                    ?>
                                <li role="article" itemscope="" itemtype="http://schema.org/Article">
                                    <?php 
                    if (mom_post_image() != false) {
                        ?>
                                    <figure class="post-thumbnail"><a href="<?php 
                        the_permalink();
                        ?>
">
                                        <?php 
                        mom_post_image_full('nb3-thumb');
                        ?>
                                    </a></figure>
                                    <?php 
                    }
                    ?>
                                    <h2 itemprop="name"><a itemprop="url" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
                                    <?php 
                    if ($post_head != 0) {
                        ?>
                                    <div class="entry-meta">
                                    	<?php 
                        if ($post_head_date != 0) {
                            ?>
                                        <time class="entry-date" datetime="<?php 
                            the_time('c');
                            ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                            mom_date_format();
                            ?>
</time>
                                        <?php 
                        }
                        ?>
                                        <?php 
                        if ($post_head_commetns != 0) {
                            ?>
                                        <div class="comments-link">
                                            <i class="momizat-icon-bubbles4"></i><a href="<?php 
                            comments_link();
                            ?>
"><?php 
                            comments_number('0', '1', '%');
                            ?>
</a>
                                        </div>
                                        <?php 
                        }
                        ?>
                                    </div>
                                    <?php 
                    }
                    ?>
                                </li>
                                <?php 
                }
            } else {
            }
            wp_reset_postdata();
            ?>
                            </ul>
                        </div>
                        
                        <?php 
            if ($show_more != 'no') {
                ?>
                        <footer class="show-more <?php 
                echo $ajax_class;
                ?>
" <?php 
                echo $sm_Atts;
                ?>
>
                                <a href="<?php 
                echo $nb_link;
                ?>
" data-post_type="<?php 
                echo $post_type;
                ?>
" data-offset="<?php 
                echo absint($number_of_posts + 2);
                ?>
" data-orig-offset="<?php 
                echo absint($number_of_posts + 2);
                ?>
"><?php 
                _e('Show More News', 'framework');
                ?>
</a>
                        </footer>
			<?php 
            }
            ?>
                        
                    </section><!--News box 3-->
                    
            <?php 
        } elseif ($style == 'nb4') {
            ?>
                    
                    <section class="section news-box <?php 
            if ($display == 'category') {
                ?>
cat_<?php 
                echo $cat;
            }
            ?>
 <?php 
            echo $class;
            ?>
"><!--News box 4-->
                                
                        <header class="block-title <?php 
            echo $head_class;
            ?>
" <?php 
            echo $head_colors;
            ?>
>
                            <h2><a href="<?php 
            echo $nb_link;
            ?>
"><?php 
            echo $nb_title;
            ?>
</a></h2>
				<?php 
            mom_nb_head($style, $cat, $display, $number_of_posts, $sub_categories, $orderby, $nb_excerpt);
            ?>
                        </header>
                        
                        <div class="nb4">
                            <?php 
            if ($display == 'category') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tag') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            }
            update_post_thumbnail_cache($query);
            if ($query->have_posts()) {
                while ($query->have_posts()) {
                    $query->the_post();
                    if ($unique_posts) {
                        $do_unique_posts[] = get_the_ID();
                    }
                    ?>
                            <div <?php 
                    post_class('first-item');
                    ?>
 role="article" itemscope="" itemtype="http://schema.org/Article">
                                <?php 
                    if (mom_post_image() != false) {
                        ?>
                                <figure class="post-thumbnail"><a href="<?php 
                        the_permalink();
                        ?>
">
                                    <?php 
                        mom_post_image_full('nb1-thumb');
                        ?>
                                    <span class="post-format-icon"></span>
                                </a></figure>
                                <?php 
                    }
                    ?>
                                <?php 
                    if (mom_post_image() != false) {
                        $mom_class = ' class="fix-right-content"';
                    } else {
                        $mom_class = '';
                    }
                    ?>
                                <div<?php 
                    echo $mom_class;
                    ?>
>
                                <h2 itemprop="name"><a itemprop="url" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
                                <div class="entry-content">
                                <?php 
                    if ($nb_excerpt != '0') {
                        ?>
  
                                    <p>
	                                        <?php 
                        global $post;
                        $excerpt = $post->post_excerpt;
                        if ($excerpt == '') {
                            $excerpt = get_the_content('');
                        }
                        if ($nb_excerpt == '') {
                            echo wp_html_excerpt(strip_shortcodes($excerpt), 110, '...');
                        } else {
                            echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...');
                        }
                        ?>
	                                    </p>
	                            <?php 
                    }
                    ?>
                                </div>
                                <?php 
                    if ($post_head != 0) {
                        ?>
                                <div class="entry-meta">
                                    <?php 
                        if ($post_head_date != 0) {
                            ?>
                                    <time class="entry-date" datetime="<?php 
                            the_time('c');
                            ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                            mom_date_format();
                            ?>
</time>
                                    <?php 
                        }
                        ?>
                                    <?php 
                        if ($post_head_commetns != 0) {
                            ?>
                                    <div class="comments-link">
                                        <i class="momizat-icon-bubbles4"></i><a href="<?php 
                            comments_link();
                            ?>
"><?php 
                            comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                            ?>
</a>
                                    </div>
                                    <?php 
                        }
                        ?>
                                </div>
                                <?php 
                    }
                    ?>
                                </div>
                            </div>
                            <?php 
                }
            } else {
            }
            wp_reset_postdata();
            ?>
                            
                            <ul>
                                <?php 
            if ($display == 'category') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tag') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            }
            update_post_thumbnail_cache($query);
            if ($query->have_posts()) {
                while ($query->have_posts()) {
                    $query->the_post();
                    if ($unique_posts) {
                        $do_unique_posts[] = get_the_ID();
                    }
                    ?>
                                <li role="article" itemscope="" itemtype="http://schema.org/Article">
                                    <?php 
                    if (mom_post_image() != false) {
                        ?>
                                    <figure class="post-thumbnail"><a href="<?php 
                        the_permalink();
                        ?>
">
                                        <?php 
                        mom_post_image_full('nb3-thumb');
                        ?>
                                    </a></figure>
                                    <?php 
                    }
                    ?>
                                    <h2 itemprop="name"><a itemprop="url" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
                                    <?php 
                    if ($post_head != 0) {
                        ?>
                                    <div class="entry-meta">
                                        <?php 
                        if ($post_head_date != 0) {
                            ?>
                                        <time class="entry-date" datetime="<?php 
                            the_time('c');
                            ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                            mom_date_format();
                            ?>
</time>
                                        <?php 
                        }
                        ?>
                                       <!--
 <div class="comments-link">
                                            <a href="<?php 
                        comments_link();
                        ?>
"><?php 
                        comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                        ?>
</a>
                                        </div>
-->
                                        
                                    </div>
                                    <?php 
                    }
                    ?>
                                </li>
                                <?php 
                }
            } else {
            }
            wp_reset_postdata();
            ?>
                            </ul>
                        </div>
                        
                        <?php 
            if ($show_more != 'no') {
                ?>
                        <footer class="show-more <?php 
                echo $ajax_class;
                ?>
" <?php 
                echo $sm_Atts;
                ?>
>
                                <a href="<?php 
                echo $nb_link;
                ?>
" data-post_type="<?php 
                echo $post_type;
                ?>
" data-offset="<?php 
                echo absint($number_of_posts + 1);
                ?>
" data-orig-offset="<?php 
                echo absint($number_of_posts + 1);
                ?>
"><?php 
                _e('Show More News', 'framework');
                ?>
</a>
                        </footer>
			<?php 
            }
            ?>
                        
                    </section><!--News box 4-->
                    
            <?php 
        } elseif ($style == 'nb5') {
            ?>
                
                    <section class="section news-box <?php 
            if ($display == 'category') {
                ?>
cat_<?php 
                echo $cat;
            }
            ?>
 <?php 
            echo $class;
            ?>
"><!--News box 5-->
                                
                        <header class="block-title <?php 
            echo $head_class;
            ?>
" <?php 
            echo $head_colors;
            ?>
>
                            <h2><a href="<?php 
            echo $nb_link;
            ?>
"><?php 
            echo $nb_title;
            ?>
</a></h2>
				<?php 
            mom_nb_head($style, $cat, $display, $number_of_posts, $sub_categories, $orderby, $nb_excerpt);
            ?>
                        </header>
                        
                        <div class="nb5">
                            <?php 
            if ($display == 'category') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tag') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            }
            update_post_thumbnail_cache($query);
            if ($query->have_posts()) {
                while ($query->have_posts()) {
                    $query->the_post();
                    if ($unique_posts) {
                        $do_unique_posts[] = get_the_ID();
                    }
                    ?>
                            <div <?php 
                    post_class('first-item');
                    ?>
 role="article" itemscope="" itemtype="http://schema.org/Article">
                                <h2 itemprop="name"><a itemprop="url" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
                                <?php 
                    if (mom_post_image() != false) {
                        ?>
                                <figure class="post-thumbnail"><a href="<?php 
                        the_permalink();
                        ?>
">
                                    <?php 
                        mom_post_image_full('nb5-thumb');
                        ?>
                                    <span class="post-format-icon"></span>
                                </a></figure>
                                <?php 
                    }
                    ?>
                                <?php 
                    if (mom_post_image() != false) {
                        $mom_class = ' class="fix-right-content"';
                    } else {
                        $mom_class = '';
                    }
                    ?>
                                <div<?php 
                    echo $mom_class;
                    ?>
>
                                <div class="entry-content">
                                <?php 
                    if ($nb_excerpt != '0') {
                        ?>
  
                                    <p>
	                                        <?php 
                        global $post;
                        $excerpt = $post->post_excerpt;
                        if ($excerpt == '') {
                            $excerpt = get_the_content('');
                        }
                        if ($nb_excerpt == '') {
                            echo wp_html_excerpt(strip_shortcodes($excerpt), 180, '...');
                        } else {
                            echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...');
                        }
                        ?>
	                                    </p>
	                            <?php 
                    }
                    ?>
                                </div>
                                <?php 
                    if ($post_head != 0) {
                        ?>
                                <div class="entry-meta">
                                	<?php 
                        if ($post_head_date != 0) {
                            ?>
                                    <time class="entry-date" datetime="<?php 
                            the_time('c');
                            ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                            mom_date_format();
                            ?>
</time>
                                    <?php 
                        }
                        ?>
                                    <?php 
                        if ($post_head_commetns != 0) {
                            ?>
                                    <div class="comments-link">
                                        <i class="momizat-icon-bubbles4"></i><a href="<?php 
                            comments_link();
                            ?>
"><?php 
                            comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                            ?>
</a>
                                    </div>
                                    <?php 
                        }
                        ?>
                                </div>
                                <?php 
                    }
                    ?>
                                </div>
                            </div>
                            <?php 
                }
            } else {
            }
            wp_reset_postdata();
            ?>
                            
                            <ul>
                                <?php 
            if ($display == 'category') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tag') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => $number_of_posts, 'offset' => 1, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            }
            update_post_thumbnail_cache($query);
            if ($query->have_posts()) {
                while ($query->have_posts()) {
                    $query->the_post();
                    if ($unique_posts) {
                        $do_unique_posts[] = get_the_ID();
                    }
                    ?>
                                <li role="article" itemscope="" itemtype="http://schema.org/Article">
                                    <h2 itemprop="name"><a itemprop="url" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
                                    <?php 
                    if ($post_head != 0) {
                        ?>
                                    <div class="entry-meta">
                                    	<?php 
                        if ($post_head_date != 0) {
                            ?>
                                        <time class="entry-date" datetime="<?php 
                            the_time('c');
                            ?>
" itemprop="dateCreated"><?php 
                            mom_date_format();
                            ?>
</time>
                                        <?php 
                        }
                        ?>
										<?php 
                        if ($post_head_commetns != 0) {
                            ?>
                                        <div class="comments-link">
                                            <a href="<?php 
                            comments_link();
                            ?>
"><?php 
                            comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                            ?>
</a>
                                        </div>
                                        <?php 
                        }
                        ?>
                                    </div>
                                    <?php 
                    }
                    ?>
                                </li>
                                <?php 
                }
            } else {
            }
            wp_reset_postdata();
            ?>
                            </ul>
                        </div>
                        
                        <?php 
            if ($show_more != 'no') {
                ?>
                        <footer class="show-more <?php 
                echo $ajax_class;
                ?>
" <?php 
                echo $sm_Atts;
                ?>
>
                                <a href="<?php 
                echo $nb_link;
                ?>
" data-post_type="<?php 
                echo $post_type;
                ?>
" data-offset="<?php 
                echo absint($number_of_posts + 1);
                ?>
" data-orig-offset="<?php 
                echo absint($number_of_posts + 1);
                ?>
"><?php 
                _e('Show More News', 'framework');
                ?>
</a>
                        </footer>
			<?php 
            }
            ?>
                         
                    </section><!--News box 5-->
                
            <?php 
        } elseif ($style == 'nb6') {
            ?>
                    
                    <section class="section news-box <?php 
            if ($display == 'category') {
                ?>
cat_<?php 
                echo $cat;
            }
            ?>
 <?php 
            echo $class;
            ?>
"><!--news box 6-->
                                
                        <header class="block-title <?php 
            echo $head_class;
            ?>
" <?php 
            echo $head_colors;
            ?>
>
                            <h2><a href="<?php 
            echo $nb_link;
            ?>
"><?php 
            echo $nb_title;
            ?>
</a></h2>
				<?php 
            mom_nb_head($style, $cat, $display, $number_of_posts, $sub_categories, $orderby, $nb_excerpt);
            ?>
                        </header>
                        
                        <div class="nb6">
                            <ul>
                                <?php 
            if ($display == 'category') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tag') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            }
            update_post_thumbnail_cache($query);
            if ($query->have_posts()) {
                while ($query->have_posts()) {
                    $query->the_post();
                    if ($unique_posts) {
                        $do_unique_posts[] = get_the_ID();
                    }
                    ?>
                                <li <?php 
                    post_class();
                    ?>
 role="article" itemscope="" itemtype="http://schema.org/Article">
                                    <?php 
                    if (mom_post_image() != false) {
                        ?>
                                    <figure class="post-thumbnail"><a href="<?php 
                        the_permalink();
                        ?>
">
                                        <?php 
                        mom_post_image_full('scroller-thumb');
                        ?>
                                        <span class="post-format-icon"></span>
                                    </a></figure>
                                    <?php 
                    }
                    ?>
                                    <?php 
                    if (mom_post_image() != false) {
                        $mom_class = ' class="fix-right-content"';
                    } else {
                        $mom_class = '';
                    }
                    ?>
									<div<?php 
                    echo $mom_class;
                    ?>
>
                                    <h2 itemprop="name"><a itemprop="url" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
                                    <div class="entry-content">
                                    <?php 
                    if ($nb_excerpt != '0') {
                        ?>
 
                                        <p>
	                                        <?php 
                        global $post;
                        $excerpt = $post->post_excerpt;
                        if ($excerpt == '') {
                            $excerpt = get_the_content('');
                        }
                        if ($nb_excerpt == '') {
                            echo wp_html_excerpt(strip_shortcodes($excerpt), 120, '...');
                        } else {
                            echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...');
                        }
                        ?>
	                                    </p>
                                    <?php 
                    }
                    ?>
                                    </div>
                                    <?php 
                    if ($post_head != 0) {
                        ?>
                                    <div class="entry-meta">
                                    	<?php 
                        if ($post_head_date != 0) {
                            ?>
                                        <time class="entry-date" datetime="<?php 
                            the_time('c');
                            ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                            mom_date_format();
                            ?>
</time>
                                        <?php 
                        }
                        ?>
                                        <?php 
                        if ($post_head_commetns != 0) {
                            ?>
                                        <div class="comments-link">
                                            <i class="momizat-icon-bubbles4"></i><a href="<?php 
                            comments_link();
                            ?>
"><?php 
                            comments_number('0', '1', '%');
                            ?>
</a>
                                        </div>
                                        <?php 
                        }
                        ?>
                                    </div>
                                    <?php 
                    }
                    ?>
									</div>
                                </li>
                                <?php 
                }
            } else {
            }
            wp_reset_postdata();
            ?>
                            </ul>
                        </div>
                        
                        <?php 
            if ($show_more != 'no') {
                ?>
                        <footer class="show-more <?php 
                echo $ajax_class;
                ?>
" <?php 
                echo $sm_Atts;
                ?>
>
                                <a href="<?php 
                echo $nb_link;
                ?>
" data-post_type="<?php 
                echo $post_type;
                ?>
" data-offset="<?php 
                echo $number_of_posts;
                ?>
" data-orig-offset="<?php 
                echo $number_of_posts;
                ?>
"><?php 
                _e('Show More News', 'framework');
                ?>
</a>
                        </footer>
			<?php 
            }
            ?>
                        
                    </section><!--news box 6-->
                    
            <?php 
        } elseif ($style == 'list') {
            ?>

		<section class="section news-box nb1 news-list <?php 
            if ($display == 'category') {
                ?>
cat_<?php 
                echo $cat;
            }
            ?>
 <?php 
            echo $class;
            ?>
"><!--News box 1-->
			                                    
                            <header class="block-title <?php 
            echo $head_class;
            ?>
" <?php 
            echo $head_colors;
            ?>
>
                                <h2><a href="<?php 
            echo $nb_link;
            ?>
"><?php 
            echo $nb_title;
            ?>
</a></h2>
				<?php 
            mom_nb_head($style, $cat, $display, $number_of_posts, $sub_categories, $orderby, $nb_excerpt);
            ?>
                            </header>
                            
                            <ul>
                                <?php 
            if ($display == 'category') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tag') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            }
            update_post_thumbnail_cache($query);
            if ($query->have_posts()) {
                while ($query->have_posts()) {
                    $query->the_post();
                    if ($unique_posts) {
                        $do_unique_posts[] = get_the_ID();
                    }
                    ?>
                                <li <?php 
                    post_class();
                    ?>
 itemscope="" itemtype="http://schema.org/Article">
                                    <h2 itemprop="name"><a itemprop="url" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
                                    <div class="entry-content">
                                    <?php 
                    if ($nb_excerpt != '0') {
                        ?>
    
                                        <p>
	                                        <?php 
                        global $post;
                        $excerpt = $post->post_excerpt;
                        if ($excerpt == '') {
                            $excerpt = get_the_content('');
                        }
                        if ($nb_excerpt == '') {
                            echo wp_html_excerpt(strip_shortcodes($excerpt), 115, '...');
                        } else {
                            echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...');
                        }
                        ?>
	                                    </p>
	                                <?php 
                    }
                    ?>
                                    </div>
                                    <?php 
                    if ($post_head != 0) {
                        ?>
                                    <div class="entry-meta">
                                    <?php 
                        if ($post_head_date != 0) {
                            ?>
                                        <time class="entry-date" datetime="<?php 
                            the_time('c');
                            ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                            mom_date_format();
                            ?>
</time>
                                        <?php 
                        }
                        ?>
                                        <?php 
                        if ($post_head_cat != 0) {
                            ?>
                                            <span class="cat-link">
                                                <i class="momizat-icon-folder-open"></i><?php 
                            the_category(', ');
                            ?>
                                            </span>
                                            <?php 
                        }
                        ?>
                                            <?php 
                        if ($post_head_commetns != 0) {
                            ?>
                                        <span class="comments-link">
                                            <i class="momizat-icon-bubbles4"></i><a href="<?php 
                            comments_link();
                            ?>
"><?php 
                            comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                            ?>
</a>
                                            
                                        </span>
                                        <?php 
                        }
                        ?>
					<div class="clear"></div>
                                    </div>
                                    <?php 
                    }
                    ?>
                                </li>
                                <?php 
                }
            } else {
            }
            wp_reset_postdata();
            ?>
                            </ul>
                            <?php 
            if ($show_more != 'no') {
                ?>
                            <footer class="show-more <?php 
                echo $ajax_class;
                ?>
" <?php 
                echo $sm_Atts;
                ?>
 >
                                <a href="<?php 
                echo $nb_link;
                ?>
" data-post_type="<?php 
                echo $post_type;
                ?>
" data-offset="<?php 
                echo $number_of_posts;
                ?>
" data-orig-offset="<?php 
                echo $number_of_posts;
                ?>
"><?php 
                _e('Show More News', 'framework');
                ?>
</a>
                            </footer>
			    <?php 
            }
            ?>
                        
                    </section><!--News box 1-->

            <?php 
        } else {
            ?>
	    
		<section class="section news-box nb1 <?php 
            if ($display == 'category') {
                ?>
cat_<?php 
                echo $cat;
            }
            ?>
 <?php 
            echo $class;
            ?>
"><!--News box 1-->
			                                    
                            <header class="block-title <?php 
            echo $head_class;
            ?>
" <?php 
            echo $head_colors;
            ?>
>
                                <h2><a href="<?php 
            echo $nb_link;
            ?>
"><?php 
            echo $nb_title;
            ?>
</a></h2>
				<?php 
            mom_nb_head($style, $cat, $display, $number_of_posts, $sub_categories, $orderby, $nb_excerpt);
            ?>
                            </header>
                            
                            <ul>
                                <?php 
            if ($display == 'category') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'cat' => $cat, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tag') {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $query = new WP_Query(array('post_status' => 'publish', 'order' => $order, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'post__not_in' => $exclude_posts, 'post_type' => $post_type, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            }
            update_post_thumbnail_cache($query);
            if ($query->have_posts()) {
                while ($query->have_posts()) {
                    $query->the_post();
                    if ($unique_posts) {
                        $do_unique_posts[] = get_the_ID();
                    }
                    ?>
                                <li <?php 
                    post_class();
                    ?>
 itemscope="" itemtype="http://schema.org/Article">
                                    <?php 
                    if (mom_post_image() != false) {
                        ?>
                                    <figure class="post-thumbnail"><a href="<?php 
                        the_permalink();
                        ?>
">
                                        <?php 
                        mom_post_image_full('nb1-thumb');
                        ?>
                                        <span class="post-format-icon"></span>
                                    </a></figure>
                                    <?php 
                    }
                    ?>
                                    <?php 
                    if (mom_post_image() != false) {
                        $mom_class = ' class="fix-right-content"';
                    } else {
                        $mom_class = '';
                    }
                    ?>
									<div<?php 
                    echo $mom_class;
                    ?>
>
                                    <h2 itemprop="name"><a itemprop="url" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
                                    <div class="entry-content">
                                    <?php 
                    if ($nb_excerpt != '0') {
                        ?>
    
                                        <p>
	                                        <?php 
                        global $post;
                        $excerpt = $post->post_excerpt;
                        if ($excerpt == '') {
                            $excerpt = get_the_content('');
                        }
                        if ($nb_excerpt == '') {
                            echo wp_html_excerpt(strip_shortcodes($excerpt), 115, '...');
                        } else {
                            echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...');
                        }
                        ?>
	                                    </p>
	                                <?php 
                    }
                    ?>
                                    </div>
                                    <?php 
                    if ($post_head != 0) {
                        ?>
                                    <div class="entry-meta">
                                    <?php 
                        if ($post_head_date != 0) {
                            ?>
                                        <time class="entry-date" datetime="<?php 
                            the_time('c');
                            ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                            mom_date_format();
                            ?>
</time>
                                        <?php 
                        }
                        ?>
                                        <?php 
                        if ($post_head_commetns != 0) {
                            ?>
                                        <div class="comments-link">
                                            <i class="momizat-icon-bubbles4"></i><a href="<?php 
                            comments_link();
                            ?>
"><?php 
                            comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                            ?>
</a>
                                            
                                        </div>
                                        <?php 
                        }
                        ?>
                                    </div>
                                    <?php 
                    }
                    ?>
									</div>
                                </li>
                                <?php 
                }
            } else {
            }
            wp_reset_postdata();
            ?>
                            </ul>
                            <?php 
            if ($show_more != 'no') {
                ?>
                            <footer class="show-more <?php 
                echo $ajax_class;
                ?>
" <?php 
                echo $sm_Atts;
                ?>
 >
                                <a href="<?php 
                echo $nb_link;
                ?>
" data-post_type="<?php 
                echo $post_type;
                ?>
" data-offset="<?php 
                echo $number_of_posts;
                ?>
" data-orig-offset="<?php 
                echo $number_of_posts;
                ?>
"><?php 
                _e('Show More News', 'framework');
                ?>
</a>
                            </footer>
			    <?php 
            }
            ?>
                        
                    </section><!--News box 1-->
		
	    <?php 
        }
        ?>

	<?php 
        $output = ob_get_contents();
        ob_end_clean();
        set_transient('mom_news_boxes_' . $id . $style . $display . $cat . $tag . $orderby . $show_more_event . $post_type, $output, 60 * 60 * 24);
    }
    return $output;
}
/**
 * Displays the link to the comments popup window for the current post ID.
 *
 * Is not meant to be displayed on single posts and pages. Should be used
 * on the lists of posts
 *
 * @global string $wpcommentspopupfile The URL to use for the popup window.
 * @global int $wpcommentsjavascript Whether to use JavaScript. Set when function is called.
 *
 * @since 0.71
 *
 * @param string $zero Optional. String to display when no comments. Default false.
 * @param string $one Optional. String to display when only one comment is available.
 *                          Default false.
 * @param string $more Optional. String to display when there are more than one comment.
 *                          Default false.
 * @param string $css_class Optional. CSS class to use for comments. Default empty.
 * @param string $none Optional. String to display when comments have been turned off.
 *                          Default false.
 */
function comments_popup_link($zero = false, $one = false, $more = false, $css_class = '', $none = false)
{
    global $wpcommentspopupfile, $wpcommentsjavascript;
    $id = get_the_ID();
    $title = get_the_title();
    $number = get_comments_number($id);
    if (false === $zero) {
        /* translators: %s: post title */
        $zero = sprintf(__('No Comments<span class="screen-reader-text"> on %s</span>'), $title);
    }
    if (false === $one) {
        /* translators: %s: post title */
        $one = sprintf(__('1 Comment<span class="screen-reader-text"> on %s</span>'), $title);
    }
    if (false === $more) {
        /* translators: 1: Number of comments 2: post title */
        $more = _n('%1$s Comment<span class="screen-reader-text"> on %2$s</span>', '%1$s Comments<span class="screen-reader-text"> on %2$s</span>', $number);
        $more = sprintf($more, number_format_i18n($number), $title);
    }
    if (false === $none) {
        /* translators: %s: post title */
        $none = sprintf(__('Comments Off<span class="screen-reader-text"> on %s</span>'), $title);
    }
    if (0 == $number && !comments_open() && !pings_open()) {
        echo '<span' . (!empty($css_class) ? ' class="' . esc_attr($css_class) . '"' : '') . '>' . $none . '</span>';
        return;
    }
    if (post_password_required()) {
        _e('Enter your password to view comments.');
        return;
    }
    echo '<a href="';
    if ($wpcommentsjavascript) {
        if (empty($wpcommentspopupfile)) {
            $home = home_url();
        } else {
            $home = get_option('siteurl');
        }
        echo $home . '/' . $wpcommentspopupfile . '?comments_popup=' . $id;
        echo '" onclick="wpopen(this.href); return false"';
    } else {
        // if comments_popup_script() is not in the template, display simple comment link
        if (0 == $number) {
            echo get_permalink() . '#respond';
        } else {
            comments_link();
        }
        echo '"';
    }
    if (!empty($css_class)) {
        echo ' class="' . $css_class . '" ';
    }
    $attributes = '';
    /**
     * Filter the comments popup link attributes for display.
     *
     * @since 2.5.0
     *
     * @param string $attributes The comments popup link attributes. Default empty.
     */
    echo apply_filters('comments_popup_link_attributes', $attributes);
    echo '>';
    comments_number($zero, $one, $more);
    echo '</a>';
}
Example #7
0
function ts_post_list_func($atts, $content = null)
{
    global $post;
    extract(shortcode_atts(array('animation' => '', 'animation_delay' => '', 'animation_iteration' => '', 'category' => '', 'limit' => 1, 'carousel_pagination' => 'yes', 'carousel_navigation' => 'yes', 'image_align' => 'left'), $atts));
    if (empty($limit)) {
        $limit = 1;
    }
    $html = '';
    $args = array('numberposts' => "", 'posts_per_page' => $limit, 'offset' => 0, 'cat' => $category, 'orderby' => 'date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post', 'post_mime_type' => '', 'post_parent' => '', 'paged' => 1, 'post_status' => 'publish');
    ob_start();
    $the_query = new WP_Query($args);
    $html = '';
    if ($the_query->have_posts()) {
        while ($the_query->have_posts()) {
            $the_query->the_post();
            $slider = '';
            $post_gallery = ts_get_post_opt('post_gallery');
            if (is_array($post_gallery) && count($post_gallery) > 0) {
                foreach ($post_gallery as $slide) {
                    $image = theme_thumb($slide['image'], 370, 270, 'c');
                    if (!empty($image)) {
                        $slider .= '<img src="' . esc_url($image) . '" alt="" title="" />';
                    }
                }
            }
            ?>
			<div class="bottom-padding <?php 
            echo ts_get_animation_class($animation);
            ?>
" <?php 
            echo ts_get_animation_data_class($animation_delay, $animation_iteration);
            ?>
>
				<div class="post carousel row no-responsive">
					<div class="images-box col-xs-12 col-sm-4 col-md-4 <?php 
            echo $image_align == 'right' ? 'pull-right' : '';
            ?>
">
						<?php 
            if (!empty($slider)) {
                ?>

							<div class="carousel-box load" data-carousel-pagination="<?php 
                echo $carousel_pagination == 'yes' ? 'true' : 'false';
                ?>
" data-carousel-nav="<?php 
                echo $carousel_navigation == 'yes' ? 'true' : 'false';
                ?>
" data-carousel-one="true">
								<div class="carousel"> 
									<?php 
                echo $slider;
                ?>
								</div>
								<div class="nav-box">
									<a class="next" href="#">
										<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="9px" height="16px" viewBox="0 0 9 16" enable-background="new 0 0 9 16" xml:space="preserve">
											<polygon fill-rule="evenodd" clip-rule="evenodd" fill="#fcfcfc" points="1,0.001 0,1.001 7,8 0,14.999 1,15.999 9,8 "></polygon>
										</svg>
									</a>
									<a class="prev" href="#">
										<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="9px" height="16px" viewBox="0 0 9 16" enable-background="new 0 0 9 16" xml:space="preserve">
											<polygon fill-rule="evenodd" clip-rule="evenodd" fill="#fcfcfc" points="8,15.999 9,14.999 2,8 9,1.001 8,0.001 0,8 "></polygon>
										</svg>
									</a>
								</div>
								<div class="clearfix"></div>
								<div class="pagination switches"></div>
							</div>
						<?php 
            } else {
                ?>
							<img src="<?php 
                echo esc_url(get_xv_thumbnail(370, 270));
                ?>
" class="single-image" />
						<?php 
            }
            ?>
					</div>

					<div class="col-xs-12 col-sm-8 col-md-8">
						<h2 class="entry-title"><a href="<?php 
            echo esc_url(get_the_permalink());
            ?>
" title="<?php 
            echo esc_attr(get_the_title());
            ?>
"><?php 
            the_title();
            ?>
</a></h2>
						<div class="entry-content">
							<?php 
            ts_the_excerpt_theme(155);
            ?>
						</div>

						<div class="entry-meta">
							<span class="autor-name"><?php 
            the_author();
            ?>
</span>,
							<span class="time"><?php 
            the_time('j.m.Y');
            ?>
</span>
							<span class="separator">|</span>
							<span class="meta"><?php 
            _e('Posted in', 'progressive');
            ?>
 <?php 
            echo get_the_category_list(', ');
            ?>
</span>
							<span class="comments-link pull-right">
								<a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number('0', '1', '%');
            ?>
 <?php 
            _e('comment(s)', 'progressive');
            ?>
</a>
							</span>
						</div>
					</div>
					<div class="clearfix"></div>
				</div><!-- .post -->
			</div>
			<?php 
        }
        wp_reset_postdata();
    }
    $html = ob_get_contents();
    ob_end_clean();
    return $html;
}
Example #8
0
/**
 * Displays the link to the comments popup window for the current post ID.
 *
 * Is not meant to be displayed on single posts and pages. Should be used on the
 * lists of posts
 *
 * @since 0.71
 * @uses $id
 * @uses $wpcommentspopupfile
 * @uses $wpcommentsjavascript
 * @uses $post
 *
 * @param string $zero The string to display when no comments
 * @param string $one The string to display when only one comment is available
 * @param string $more The string to display when there are more than one comment
 * @param string $css_class The CSS class to use for comments
 * @param string $none The string to display when comments have been turned off
 * @return null Returns null on single posts and pages.
 */
function comments_popup_link($zero = false, $one = false, $more = false, $css_class = '', $none = false)
{
    global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post;
    if (false === $zero) {
        $zero = __('No Comments');
    }
    if (false === $one) {
        $one = __('1 Comment');
    }
    if (false === $more) {
        $more = __('% Comments');
    }
    if (false === $none) {
        $none = __('Comments Off');
    }
    $number = get_comments_number($id);
    if (0 == $number && !comments_open() && !pings_open()) {
        echo '<span' . (!empty($css_class) ? ' class="' . esc_attr($css_class) . '"' : '') . '>' . $none . '</span>';
        return;
    }
    if (post_password_required()) {
        echo __('Enter your password to view comments');
        return;
    }
    echo '<a href="';
    if ($wpcommentsjavascript) {
        if (empty($wpcommentspopupfile)) {
            $home = get_option('home');
        } else {
            $home = get_option('siteurl');
        }
        echo $home . '/' . $wpcommentspopupfile . '?comments_popup=' . $id;
        echo '" onclick="wpopen(this.href); return false"';
    } else {
        // if comments_popup_script() is not in the template, display simple comment link
        if (0 == $number) {
            echo get_permalink() . '#respond';
        } else {
            comments_link();
        }
        echo '"';
    }
    if (!empty($css_class)) {
        echo ' class="' . $css_class . '" ';
    }
    $title = esc_attr(get_the_title());
    echo apply_filters('comments_popup_link_attributes', '');
    echo ' title="' . esc_attr(sprintf(__('Comment on %s'), $title)) . '">';
    comments_number($zero, $one, $more, $number);
    echo '</a>';
}
	<?php do_action('rss2_ns'); ?>
>

<channel>
	<title><?php bloginfo_rss('name'); ?></title>
	<link><?php bloginfo_rss('url') ?></link>
	<description><?php bloginfo_rss("description") ?></description>
	<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate>
	<generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator>
	<language><?php echo get_option('rss_language'); ?></language>
	<?php do_action('rss2_head'); ?>
	<?php while( have_posts()) : the_post(); ?>
	<item>
		<title><?php the_title_rss() ?></title>
		<link><?php permalink_single_rss() ?></link>
		<comments><?php comments_link(); ?></comments>
		<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
		<dc:creator><?php the_author() ?></dc:creator>
		<?php the_category_rss() ?>

		<guid isPermaLink="false"><?php the_guid(); ?></guid>
<?php if (get_option('rss_use_excerpt')) : ?>
		<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
<?php else : ?>
		<description><![CDATA[<?php the_excerpt_rss() ?>]]></description>
	<?php if ( strlen( $post->post_content ) > 0 ) : ?>
		<content:encoded><![CDATA[<?php the_content() ?>]]></content:encoded>
	<?php else : ?>
		<content:encoded><![CDATA[<?php the_excerpt_rss() ?>]]></content:encoded>
	<?php endif; ?>
<?php endif; ?>
Example #10
0
function mom_nb_show_more()
{
    // stay away from bad guys
    $nonce = $_POST['nonce'];
    $nbs = $_POST['nbs'];
    $number_of_posts = $_POST['number_of_posts'];
    $orderby = $_POST['orderby'];
    $offset = $_POST['offset'];
    $offset_second = $_POST['offset_second'];
    $offset_all = $_POST['offset_all'];
    $cat = $_POST['cat'];
    if (!wp_verify_nonce($nonce, 'ajax-nonce')) {
        die('Nope!');
    }
    $hpmeta = mom_option('post_meta_hp');
    if ($nbs == 'nb1') {
        $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => $offset, 'orderby' => $orderby, 'post_status' => 'publish'));
        if ($query->have_posts()) {
            while ($query->have_posts()) {
                $query->the_post();
                ?>
<li <?php 
                post_class();
                ?>
 itemscope="" itemtype="http://schema.org/Article">
<?php 
                if (mom_post_image() != false) {
                    ?>
<figure class="post-thumbnail"><a href="<?php 
                    the_permalink();
                    ?>
">
<?php 
                    mom_post_image_full('nb1-thumb');
                    ?>
<span class="post-format-icon"></span>
</a></figure>
<?php 
                }
                if (mom_post_image() != false) {
                    $mom_class = ' class="fix-right-content"';
                } else {
                    $mom_class = '';
                }
                ?>
<div<?php 
                echo $mom_class;
                ?>
>
<h2 itemprop="name"><a itemprop="url" href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
<div class="entry-content">
<?php 
                if ($nb_excerpt != '0') {
                    ?>
    
<p>
<?php 
                    global $post;
                    $excerpt = $post->post_excerpt;
                    if ($excerpt == '') {
                        $excerpt = get_the_content('');
                    }
                    if ($nb_excerpt == '') {
                        echo wp_html_excerpt(strip_shortcodes($excerpt), 115, '...');
                    } else {
                        echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...');
                    }
                    ?>
</p>
<?php 
                }
                ?>
</div>
<?php 
                if ($hpmeta == 1) {
                    ?>
<div class="entry-meta">
<time class="entry-date" datetime="<?php 
                    the_time('c');
                    ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                    mom_date_format();
                    ?>
</time>
<div class="comments-link">
<i class="momizat-icon-bubbles4"></i><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                    ?>
</a>
</div>
</div>
<?php 
                }
                ?>
</div>
</li>
<?php 
            }
        } else {
        }
        wp_reset_postdata();
    } elseif ($nbs == 'nb2') {
        $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => 1, 'offset' => $offset, 'orderby' => $orderby, 'post_status' => 'publish'));
        if ($query->have_posts()) {
            while ($query->have_posts()) {
                $query->the_post();
                ?>
<div <?php 
                post_class('first-item');
                ?>
 role="article" itemscope="" itemtype="http://schema.org/Article">
<?php 
                if (mom_post_image() != false) {
                    ?>
<figure class="post-thumbnail"><a href="<?php 
                    the_permalink();
                    ?>
">
<?php 
                    mom_post_image_full('nb1-thumb');
                    ?>
<span class="post-format-icon"></span>
</a></figure>
<?php 
                }
                if (mom_post_image() != false) {
                    $mom_class = ' class="fix-right-content"';
                } else {
                    $mom_class = '';
                }
                ?>
<div<?php 
                echo $mom_class;
                ?>
>
<?php 
                if ($hpmeta == 1) {
                    ?>
<div class="entry-meta">
<time class="entry-date" datetime="<?php 
                    the_time('c');
                    ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                    mom_date_format();
                    ?>
</time>
<div class="comments-link">
<i class="momizat-icon-bubbles4"></i><a href="<?php 
                    comments_link();
                    ?>
"><?php 
                    comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                    ?>
</a>
</div>
</div>
<?php 
                }
                ?>
<h2 itemprop="name"><a itemprop="url" href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
<div class="entry-content">
<?php 
                if ($nb_excerpt != '0') {
                    ?>
  
<p>
<?php 
                    global $post;
                    $excerpt = $post->post_excerpt;
                    if ($excerpt == '') {
                        $excerpt = get_the_content('');
                    }
                    if ($nb_excerpt == '') {
                        echo wp_html_excerpt(strip_shortcodes($excerpt), 145, '...');
                    } else {
                        echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...');
                    }
                    ?>
</p>
<?php 
                }
                ?>
</div>
</div>
</div>

<?php 
            }
        } else {
        }
        wp_reset_postdata();
        $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => $offset_all, 'orderby' => $orderby, 'post_status' => 'publish'));
        if ($query->have_posts()) {
            echo '<ul>';
            while ($query->have_posts()) {
                $query->the_post();
                ?>
<li role="article" itemscope="" itemtype="http://schema.org/Article">
<h2 itemprop="name"><a itemprop="url" href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
<?php 
                if ($hpmeta == 1) {
                    ?>
<div class="entry-meta">
<time class="entry-date" datetime="<?php 
                    the_time('c');
                    ?>
" itemprop="dateCreated"><?php 
                    mom_date_format();
                    ?>
</time>
<div class="comments-link">
<a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                    ?>
</a>
</div>
</div>
<?php 
                }
                ?>
</li>
<?php 
            }
            echo '</ul>';
        } else {
        }
        wp_reset_postdata();
    } elseif ($nbs == 'nb3') {
        $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => 2, 'offset' => $offset, 'orderby' => $orderby, 'post_status' => 'publish'));
        if ($query->have_posts()) {
            while ($query->have_posts()) {
                $query->the_post();
                ?>
<div <?php 
                post_class('first-item');
                ?>
 role="article" itemscope="" itemtype="http://schema.org/Article">
<?php 
                if (mom_post_image() != false) {
                    ?>
<figure class="post-thumbnail"><a href="<?php 
                    the_permalink();
                    ?>
">
<?php 
                    mom_post_image_full('nb1-thumb');
                    ?>
<span class="post-format-icon"></span>
</a></figure>
<?php 
                }
                if (mom_post_image() != false) {
                    $mom_class = ' class="fix-right-content"';
                } else {
                    $mom_class = '';
                }
                ?>
<div<?php 
                echo $mom_class;
                ?>
>
<h2 itemprop="name"><a itemprop="url" href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
<div class="entry-content">
<?php 
                if ($nb_excerpt != '0') {
                    ?>
  
<p>
<?php 
                    global $post;
                    $excerpt = $post->post_excerpt;
                    if ($excerpt == '') {
                        $excerpt = get_the_content('');
                    }
                    if ($nb_excerpt == '') {
                        echo wp_html_excerpt(strip_shortcodes($excerpt), 115, '...');
                    } else {
                        echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...');
                    }
                    ?>
</p>
<?php 
                }
                ?>
</div>
<?php 
                if ($hpmeta == 1) {
                    ?>
<div class="entry-meta">
<time class="entry-date" datetime="<?php 
                    the_time('c');
                    ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                    mom_date_format();
                    ?>
</time>
<div class="comments-link">
<i class="momizat-icon-bubbles4"></i><a href="<?php 
                    comments_link();
                    ?>
"><?php 
                    comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                    ?>
</a>
</div>
</div>
<?php 
                }
                ?>
</div>
</div>
<?php 
            }
        } else {
        }
        wp_reset_postdata();
        $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => $offset_all, 'orderby' => $orderby, 'post_status' => 'publish'));
        if ($query->have_posts()) {
            echo '<ul>';
            while ($query->have_posts()) {
                $query->the_post();
                ?>
<li role="article" itemscope="" itemtype="http://schema.org/Article">
<?php 
                if (mom_post_image() != false) {
                    ?>
<figure class="post-thumbnail"><a href="<?php 
                    the_permalink();
                    ?>
">
<?php 
                    mom_post_image_full('nb3-thumb');
                    ?>
</a></figure>
<?php 
                }
                ?>
<h2 itemprop="name"><a itemprop="url" href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
<?php 
                if ($hpmeta == 1) {
                    ?>
<div class="entry-meta">
<time class="entry-date" datetime="<?php 
                    the_time('c');
                    ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                    mom_date_format();
                    ?>
</time>
<div class="comments-link">
<i class="momizat-icon-bubbles4"></i><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    comments_number('(0)', '(1)', '(%)');
                    ?>
</a>
</div>
</div>
<?php 
                }
                ?>
</li>
<?php 
            }
            echo '</ul>';
        } else {
        }
        wp_reset_postdata();
    } elseif ($nbs == 'nb4') {
        $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => 1, 'offset' => $offset, 'orderby' => $orderby, 'post_status' => 'publish'));
        if ($query->have_posts()) {
            while ($query->have_posts()) {
                $query->the_post();
                ?>
<div <?php 
                post_class('first-item');
                ?>
 role="article" itemscope="" itemtype="http://schema.org/Article">
<?php 
                if (mom_post_image() != false) {
                    ?>
<figure class="post-thumbnail"><a href="<?php 
                    the_permalink();
                    ?>
">
<?php 
                    mom_post_image_full('nb1-thumb');
                    ?>
<span class="post-format-icon"></span>
</a></figure>
<?php 
                }
                if (mom_post_image() != false) {
                    $mom_class = ' class="fix-right-content"';
                } else {
                    $mom_class = '';
                }
                ?>
<div<?php 
                echo $mom_class;
                ?>
>
<h2 itemprop="name"><a itemprop="url" href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
<div class="entry-content">
<?php 
                if ($nb_excerpt != '0') {
                    ?>
  
<p>
<?php 
                    global $post;
                    $excerpt = $post->post_excerpt;
                    if ($excerpt == '') {
                        $excerpt = get_the_content('');
                    }
                    if ($nb_excerpt == '') {
                        echo wp_html_excerpt(strip_shortcodes($excerpt), 110, '...');
                    } else {
                        echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...');
                    }
                    ?>
</p>
<?php 
                }
                ?>
</div>
<?php 
                if ($hpmeta == 1) {
                    ?>
<div class="entry-meta">
<time class="entry-date" datetime="<?php 
                    the_time('c');
                    ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                    mom_date_format();
                    ?>
</time>
<div class="comments-link">
<i class="momizat-icon-bubbles4"></i><a href="<?php 
                    comments_link();
                    ?>
"><?php 
                    comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                    ?>
</a>
</div>
</div>
<?php 
                }
                ?>
</div>
</div>
<?php 
            }
        } else {
        }
        wp_reset_postdata();
        $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => $offset_all, 'orderby' => $orderby, 'post_status' => 'publish'));
        if ($query->have_posts()) {
            echo '<ul>';
            while ($query->have_posts()) {
                $query->the_post();
                ?>
<li role="article" itemscope="" itemtype="http://schema.org/Article">
<?php 
                if (mom_post_image() != false) {
                    ?>
<figure class="post-thumbnail"><a href="<?php 
                    the_permalink();
                    ?>
">
<?php 
                    mom_post_image_full('nb3-thumb');
                    ?>
</a></figure>
<?php 
                }
                ?>
<h2 itemprop="name"><a itemprop="url" href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
<?php 
                if ($hpmeta == 1) {
                    ?>
<div class="entry-meta">
<time class="entry-date" datetime="<?php 
                    the_time('c');
                    ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                    mom_date_format();
                    ?>
</time>
<!--
<div class="comments-link">
<a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                    ?>
</a>
</div>
-->
</div>
<?php 
                }
                ?>
</li>
<?php 
            }
            echo '</ul>';
        } else {
        }
        wp_reset_postdata();
    } elseif ($nbs == 'nb5') {
        $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => 1, 'offset' => $offset, 'orderby' => $orderby, 'post_status' => 'publish'));
        if ($query->have_posts()) {
            while ($query->have_posts()) {
                $query->the_post();
                ?>
<div <?php 
                post_class('first-item');
                ?>
 role="article" itemscope="" itemtype="http://schema.org/Article">
<h2 itemprop="name"><a itemprop="url" href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
<?php 
                if (mom_post_image() != false) {
                    ?>
<figure class="post-thumbnail"><a href="<?php 
                    the_permalink();
                    ?>
">
<?php 
                    mom_post_image_full('nb5-thumb');
                    ?>
<span class="post-format-icon"></span>
</a></figure>
<?php 
                }
                if (mom_post_image() != false) {
                    $mom_class = ' class="fix-right-content"';
                } else {
                    $mom_class = '';
                }
                ?>
<div<?php 
                echo $mom_class;
                ?>
>
<div class="entry-content">
<?php 
                if ($nb_excerpt != '0') {
                    ?>
  
<p>
<?php 
                    global $post;
                    $excerpt = $post->post_excerpt;
                    if ($excerpt == '') {
                        $excerpt = get_the_content('');
                    }
                    if ($nb_excerpt == '') {
                        echo wp_html_excerpt(strip_shortcodes($excerpt), 180, '...');
                    } else {
                        echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...');
                    }
                    ?>
</p>
<?php 
                }
                ?>
</div>
<?php 
                if ($hpmeta == 1) {
                    ?>
<div class="entry-meta">
<time class="entry-date" datetime="<?php 
                    the_time('c');
                    ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                    mom_date_format();
                    ?>
</time>
<div class="comments-link">
<i class="momizat-icon-bubbles4"></i><a href="<?php 
                    comments_link();
                    ?>
"><?php 
                    comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                    ?>
</a>
</div>
</div>
<?php 
                }
                ?>
</div>
</div>
<?php 
            }
        } else {
        }
        wp_reset_postdata();
        $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => $offset_all, 'orderby' => $orderby, 'post_status' => 'publish'));
        if ($query->have_posts()) {
            echo '<ul>';
            while ($query->have_posts()) {
                $query->the_post();
                ?>
<li role="article" itemscope="" itemtype="http://schema.org/Article">
<h2 itemprop="name"><a itemprop="url" href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
<?php 
                if ($hpmeta == 1) {
                    ?>
<div class="entry-meta">
<time class="entry-date" datetime="<?php 
                    the_time('c');
                    ?>
" itemprop="dateCreated"><?php 
                    mom_date_format();
                    ?>
</time>
<div class="comments-link">
<a href="#"><?php 
                    comments_number(__('(0) Comments', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
                    ?>
</a>
</div>
</div>
<?php 
                }
                ?>
</li>
<?php 
            }
            echo '</ul>';
        } else {
        }
        wp_reset_postdata();
    } elseif ($nbs == 'nb6') {
        $query = new WP_Query(array('cat' => $cat, 'posts_per_page' => $number_of_posts, 'offset' => $offset, 'orderby' => $orderby, 'post_status' => 'publish'));
        if ($query->have_posts()) {
            echo '<ul>';
            while ($query->have_posts()) {
                $query->the_post();
                ?>
<li <?php 
                post_class();
                ?>
 role="article" itemscope="" itemtype="http://schema.org/Article">
<?php 
                if (mom_post_image() != false) {
                    ?>
<figure class="post-thumbnail"><a href="<?php 
                    the_permalink();
                    ?>
">
<?php 
                    mom_post_image_full('nb5-thumb');
                    ?>
<span class="post-format-icon"></span>
</a></figure>
<?php 
                }
                if (mom_post_image() != false) {
                    $mom_class = ' class="fix-right-content"';
                } else {
                    $mom_class = '';
                }
                ?>
<div<?php 
                echo $mom_class;
                ?>
>
<h2 itemprop="name"><a itemprop="url" href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h2>
<div class="entry-content">
<?php 
                if ($nb_excerpt != '0') {
                    ?>
 
<p>
<?php 
                    global $post;
                    $excerpt = $post->post_excerpt;
                    if ($excerpt == '') {
                        $excerpt = get_the_content('');
                    }
                    if ($nb_excerpt == '') {
                        echo wp_html_excerpt(strip_shortcodes($excerpt), 120, '...');
                    } else {
                        echo wp_html_excerpt(strip_shortcodes($excerpt), $nb_excerpt, '...');
                    }
                    ?>
</p>
<?php 
                }
                ?>
</div>
<?php 
                if ($hpmeta == 1) {
                    ?>
<div class="entry-meta">
<time class="entry-date" datetime="<?php 
                    the_time('c');
                    ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                    mom_date_format();
                    ?>
</time>
<div class="comments-link">
<i class="momizat-icon-bubbles4"></i><a href="#"><?php 
                    comments_number('(0)', '(1)', '(%)');
                    ?>
</a>
</div>
</div>
<?php 
                }
                ?>
</div>
</li>
<?php 
            }
            echo '</ul>';
        } else {
        }
        wp_reset_postdata();
    }
    exit;
}
Example #11
0
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $show_number = $instance['show_number'];
        $show_img = $instance['show_img'] == "yes" ? true : false;
        ?>
		
		<div class="widget-grey-bg">
		
			<?php 
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>
				
				<div class="recent-posts-widget">
					<ul class="clearfix">
					<?php 
        $the_query = new WP_Query("showposts={$show_number}");
        while ($the_query->have_posts()) {
            $the_query->the_post();
            ?>
						
						<li class="clearfix">
						
							<?php 
            if (function_exists('has_post_thumbnail') && has_post_thumbnail() && $show_img) {
                ?>
								<div class="post-thumb">
									<a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                the_title();
                ?>
"><?php 
                resize_img("width=55&height=55");
                ?>
</a>
								</div>
							<?php 
            }
            ?>
								<div class="detail">
									<h3 class="entry-title"><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h3>
									<span class="entry-meta"><?php 
            the_time(get_option('date_format'));
            ?>
 // <a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number(__('No Comments', 'theme_textdomain'), __('1 Comment', 'theme_textdomain'), __('% Comments', 'theme_textdomain'));
            ?>
</a></span>
								</div>
							
						</li>				
					<?php 
        }
        ?>
					</ul>
				</div>
	
		<?php 
        echo $after_widget;
        ?>
			
		
	</div>	
		
	<?php 
    }
Example #12
0
function arras_widgets_post_loop($id, $args = array())
{
    global $wp_query, $post;
    $_defaults = array('taxonomy' => 'category', 'show_thumbs' => true, 'show_excerpt' => true, 'query' => array('post_type' => 'post', 'posts_per_page' => 5, 'orderby' => 'date', 'order' => 'DESC'));
    $args['query'] = wp_parse_args($args['query'], $_defaults['query']);
    $args = wp_parse_args($args, $_defaults);
    $q = new WP_Query(arras_prep_query($args));
    if ($q->have_posts()) {
        echo '<ul class="' . $id . '">';
        while ($q->have_posts()) {
            $q->the_post();
            // hack for plugin authors who love to use $post = $wp_query->post
            $wp_query->post = $q->post;
            setup_postdata($post);
            ?>
 <li class="clearfix"> <?php 
            if ($args['show_thumbs']) {
                echo '<a rel="bookmark" href="' . get_permalink() . '" class="thumb">' . arras_get_thumbnail('sidebar-thumb', get_the_ID()) . '</a>';
            }
            ?>
			<a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a><br />
			<span class="sub"><?php 
            printf(__('Posted %s', 'arras'), arras_posted_on(false));
            ?>
 | 
			<a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number(__('No Comments', 'arras'), __('1 Comment', 'arras'), __('% Comments', 'arras'));
            ?>
</a>
			</span>
			
			<?php 
            if ($args['show_excerpt']) {
                ?>
			<p class="excerpt">
			<?php 
                echo get_the_excerpt();
                ?>
			</p>
			<a class="sidebar-read-more" href="<?php 
                the_permalink();
                ?>
"><?php 
                _e('Read More', 'arras');
                ?>
</a>
			<?php 
            }
            ?>
			
			</li>
			<?php 
        }
        echo '</ul>';
    } else {
        echo '<span class="textCenter sub">' . __('No posts at the moment. Check back again later!', 'arras') . '</span>';
    }
    wp_reset_query();
}
function engine_slider_sc($atts)
{
    // Variables
    extract(shortcode_atts(array('title' => 'Slider', 'qty' => '4', 'category' => '', 'autoplay' => '5000', 'random' => false, 'thumb_size' => 'large', 'excerpt_length' => '30'), $atts));
    // Defaults
    if (!isset($category)) {
        $category = '';
    }
    if (!isset($random)) {
        $random = '0';
    }
    if (!isset($autoplay)) {
        $autoplay = '0';
    }
    if (!isset($qty)) {
        $qty = '-1';
    }
    if (!isset($thumb_size)) {
        $thumb_size = 'large';
    }
    if (!isset($excerpt_length)) {
        $excerpt_length = '30';
    }
    if (!empty($category)) {
        // Make category an array
        $category = explode(', ', $category);
        $args['category__in'] = $category;
    }
    // Args for the query
    $args = array('posts_per_page' => $qty, 'category__in' => $category);
    $q = new WP_Query($args);
    if ($q->have_posts()) {
        // This is needed for a bunch of HTML
        ob_start();
        ?>
	
	<?php 
        if ($title) {
            ?>
	<h4 class="widget-title"><?php 
            echo stripslashes($title);
            ?>
</h4>
	<?php 
        }
        ?>
	
	<div class="slider flexslider" data-autoplay="<?php 
        echo $autoplay;
        ?>
" data-random="<?php 
        echo $random;
        ?>
">
	
		<ul class="slides">
			
			<?php 
        while ($q->have_posts()) {
            $q->the_post();
            ?>
			<li <?php 
            post_class();
            ?>
>
	
				<article class="the-post">
				
					<div class="featured-image">
						
						<a href="<?php 
            the_permalink();
            ?>
"><?php 
            engine_thumbnail($thumb_size);
            ?>
</a>
						
					</div>
					<!-- /.featured-image -->
							
					<!-- .entry-header -->
					<header class="entry-header">
						
						<div class="entry-meta">
							<span class="entry-comments"><a href="<?php 
            comments_link();
            ?>
"><i class="icon-comments"></i><?php 
            comments_number(0, 1, '%');
            ?>
</a></span>
							<span class="entry-category"><i class="icon-folder-open"></i><?php 
            the_category(', ');
            ?>
</span>
							<span class="entry-date"><i class="icon-calendar"></i><?php 
            the_time(get_option('date_format'));
            ?>
</span>				
						</div>
					
						<h2 class="entry-title"><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h2>
						
					</header>
					<!-- /.entry-header -->
	
					<?php 
            if ($excerpt_length != '0') {
                ?>
					
						<div class="entry-content">
							<?php 
                echo wpautop(engine_excerpt($excerpt_length));
                ?>
						</div>
						
					<?php 
            }
            ?>

				</article>
				<!-- /.the-post -->
				
			</li>
			<?php 
        }
        ?>
			
		</ul>
		
	</div>
	<?php 
    } else {
        ?>
	<span class="radius secondary label"><?php 
        _e('No posts found', 'engine');
        ?>
</span>
	<?php 
    }
    wp_reset_query();
    $output = ob_get_contents();
    ob_end_clean();
    return $output;
}
Example #14
0
    function gazeta_post_meta($content)
    {
        global $post;
        if (!isset($post->ID) || get_post_type($post) != 'post' && !is_single() && is_main_query()) {
            return $content;
        }
        ob_start();
        ?>
			<div class="ns-meta entry-meta">
				<div class="nsm-inner">
					<span><i class="fa fa-clock-o"></i> <a href="<?php 
        print gazeta_get_post_archive_link($post->ID);
        ?>
"><?php 
        print get_the_date();
        ?>
</a></span>
					<?php 
        if (get_comments_number()) {
            ?>
						<span><a href="<?php 
            comments_link();
            ?>
"><i class="fa fa-comments"></i> <?php 
            print get_comments_number();
            ?>
</a></span>
					<?php 
            if (gazeta_get_post_views($post->ID) > 0) {
                ?>
						<span><i class="fa fa-eye"></i> <?php 
                print gazeta_get_post_views($post->ID);
                ?>
</span>
					<?php 
            }
            ?>
					<?php 
        }
        ?>
					<?php 
        do_action('gazeta_post_meta/meta');
        ?>
				</div>
			</div>
		<?php 
        return $content . ob_get_clean();
    }
 function comments_popup_link($zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $CSSclass = '', $none = 'Comments Off', $echo = true)
 {
     if (get_xoops_option(wp_mod(), 'wp_use_xoops_comments') == 0) {
         if (empty($GLOBALS['comment_count_cache'][wp_id()]["{$GLOBALS['wp_post_id']}"])) {
             $criteria =& new CriteriaCompo(new Criteria('comment_post_ID', $GLOBALS['wp_post_id']));
             $criteria->add(new Criteria('comment_approved', '1 '));
             // Trick for numeric chars only string compare
             $commentHandler =& wp_handler('Comment');
             $number = $commentHandler->getCount($criteria);
         } else {
             $number = $GLOBALS['comment_count_cache'][wp_id()]["{$GLOBALS['wp_post_id']}"];
         }
     } else {
         $criteria =& new CriteriaCompo(new Criteria('comment_post_ID', $GLOBALS['wp_post_id']));
         $criteria->add(new Criteria('comment_approved', '1 '));
         // Trick for numeric chars only string compare
         $criteria_c =& new CriteriaCompo(new Criteria('comment_content', "<trackback />%", 'like'));
         $criteria_c->add(new Criteria('comment_content', "<pingback />%", 'like'), 'OR');
         $criteria_c->add(new Criteria('comment_type', 'trackback'), 'OR');
         $criteria_c->add(new Criteria('comment_type', 'pingback'), 'OR');
         $criteria->add($criteria_c);
         $commentHandler =& wp_handler('Comment');
         $number = $commentHandler->getCount($criteria);
     }
     $comments_popup_link = "";
     if (0 == $number && 'closed' == $GLOBALS['post']->comment_status && 'closed' == $GLOBALS['post']->ping_status) {
         return _echo($none, $echo);
     } else {
         if (!empty($GLOBALS['post']->post_password)) {
             // if there's a password
             if ($_COOKIE['wp-postpass_' . $GLOBALS['cookiehash']] != $GLOBALS['post']->post_password) {
                 // and it doesn't match the cookie
                 return _echo("Enter your password to view comments", $echo);
             }
         }
         $comments_popup_link .= '<a href="';
         if (!empty($GLOBALS['wpcommentsjavascript'])) {
             $comments_popup_link .= wp_siteurl() . '/' . $GLOBALS['wpcommentspopupfile'] . '?p=' . $GLOBALS['wp_post_id'] . '&amp;c=1';
             $comments_popup_link .= '" onclick="wpopen(this.href); return false"';
         } else {
             // if comments_popup_script() is not in the template, display simple comment link
             $comments_popup_link .= comments_link('', false);
             $comments_popup_link .= '"';
         }
         $comments_popup_link .= ' title="Comment for \'\'' . apply_filters('the_title', $GLOBALS['post']->post_title) . '\'\'"';
         if (!empty($CSSclass)) {
             $comments_popup_link .= ' class="' . $CSSclass . '"';
         }
         $comments_popup_link .= '>';
         $comments_popup_link .= comments_number($zero, $one, $more, $number, false);
         $comments_popup_link .= '</a>';
         return _echo($comments_popup_link, $echo);
     }
 }
    /**
     * 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 (!isset($args['widget_id'])) {
            $args['widget_id'] = $this->id;
        }
        $title = __('Recent Posts', 'dutility');
        $max = 5;
        $sortby = date;
        $orderby = 'asc';
        if (!empty($instance['title'])) {
            $title = $instance['title'];
        }
        if (!empty($instance['max'])) {
            $max = absint($max);
        }
        if (!empty($instance['sortby'])) {
            $sortby = $instance['sortby'];
        }
        if (!empty($instance['orderby'])) {
            $orderby = $instance['orderby'];
        }
        $title = apply_filters('widget_title', $title, $instance, $this->id_base);
        $stmt = new WP_Query(apply_filters('widget_posts_args', array('posts_per_page' => $max, 'orderby' => $sortby, 'order' => $orderby, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true)));
        if ($stmt->have_posts()) {
            ?>
		<?php 
            echo $args['before_widget'];
            ?>

		<?php 
            echo $args['before_title'] . esc_html($title) . $args['after_title'];
            ?>
		<ul>
      <?php 
            while ($stmt->have_posts()) {
                $stmt->the_post();
                ?>
  			<li>
          <a href="<?php 
                esc_url(the_permalink());
                ?>
" class="dunhakdis_blog_post_img" >
            <?php 
                the_post_thumbnail('thumbnail');
                ?>
          </a>
  				<a href="<?php 
                esc_url(the_permalink());
                ?>
" class="dunhakdis_blog_post_title">
            <?php 
                the_title('<h3>', '</h3>');
                ?>
          </a>
          <a href="<?php 
                echo esc_url(comments_link());
                ?>
" class="dunhakdis_blog_post_comment" >
              <?php 
                _e('Leave a comment.', 'dutility');
                ?>
          </a>
  			</li>
		  <?php 
            }
            ?>
		</ul>
		<?php 
            echo $args['after_widget'];
            ?>
		<?php 
            // Reset the global $the_post as this query will have stomped on it
            wp_reset_postdata();
        }
    }
Example #17
0
    function nectar_page_header($postid)
    {
        global $options;
        global $post;
        global $nectar_theme_skin;
        $bg = get_post_meta($postid, '_nectar_header_bg', true);
        $bg_color = get_post_meta($postid, '_nectar_header_bg_color', true);
        $font_color = get_post_meta($postid, '_nectar_header_font_color', true);
        $parallax_bg = get_post_meta($postid, '_nectar_header_parallax', true);
        $title = get_post_meta($postid, '_nectar_header_title', true);
        $subtitle = get_post_meta($postid, '_nectar_header_subtitle', true);
        $height = get_post_meta($postid, '_nectar_header_bg_height', true);
        $page_template = get_post_meta($postid, '_wp_page_template', true);
        $display_sortable = get_post_meta($postid, 'nectar-metabox-portfolio-display-sortable', true);
        $inline_filters = !empty($options['portfolio_inline_filters']) && $options['portfolio_inline_filters'] == '1' ? '1' : '0';
        $filters_id = !empty($options['portfolio_inline_filters']) && $options['portfolio_inline_filters'] == '1' ? 'portfolio-filters-inline' : 'portfolio-filters';
        $text_align = get_post_meta($postid, '_nectar_page_header_alignment', true);
        $text_align_v = get_post_meta($postid, '_nectar_page_header_alignment_v', true);
        $fullscreen_header = !empty($options['blog_header_type']) && $options['blog_header_type'] == 'fullscreen' && is_singular('post') ? true : false;
        $bottom_shadow = get_post_meta($postid, '_nectar_header_bottom_shadow', true);
        $bg_overlay = get_post_meta($postid, '_nectar_header_overlay', true);
        $text_effect = get_post_meta($postid, '_nectar_page_header_text-effect', true);
        !empty($display_sortable) && $display_sortable == 'on' ? $display_sortable = '1' : ($display_sortable = '0');
        //incase no title is entered for portfolio, still show the filters
        if ($page_template == 'template-portfolio.php' && empty($title)) {
            $title = get_the_title($post->ID);
        }
        $bg_type = get_post_meta($postid, '_nectar_slider_bg_type', true);
        if (empty($bg_type)) {
            $bg_type = 'image_bg';
        }
        if (!empty($bg) || !empty($bg_color) || $bg_type == 'video_bg' || $bg_type == 'particle_bg') {
            empty($bg) ? $social_img_src = 'none' : ($social_img_src = $bg);
            empty($bg) ? $bg = 'none' : ($bg = 'url(' . $bg . ')');
            if ($bg_type == 'image_bg' || $bg_type == 'particle_bg') {
                empty($bg_color) ? $bg_color = '#000' : ($bg_color = $bg_color);
            } else {
                $bg = 'none';
                //remove stnd bg image for video BG type
            }
            $bg_color_string = !empty($bg_color) ? 'background-color: ' . $bg_color . '; ' : null;
            if ($bg_type == 'particle_bg') {
                $rotate_timing = get_post_meta($postid, '_nectar_particle_rotation_timing', true);
                $disable_explosion = get_post_meta($postid, '_nectar_particle_disable_explosion', true);
                $shapes = get_post_meta($postid, '_nectar_canvas_shapes', true);
                if (empty($shapes)) {
                    $bg_type = 'image_bg';
                }
            }
            if ($bg_type == 'video_bg') {
                $video_webm = get_post_meta($postid, '_nectar_media_upload_webm', true);
                $video_mp4 = get_post_meta($postid, '_nectar_media_upload_mp4', true);
                $video_ogv = get_post_meta($postid, '_nectar_media_upload_ogv', true);
                $video_image = get_post_meta($postid, '_nectar_slider_preview_image', true);
            }
            $box_roll = get_post_meta($postid, '_nectar_header_box_roll', true);
            if (!empty($options['boxed_layout']) && $options['boxed_layout'] == '1') {
                $box_roll = 'off';
            }
            $bg_position = get_post_meta($postid, '_nectar_page_header_bg_alignment', true);
            if (empty($bg_position)) {
                $bg_position = 'top';
            }
            $height = !empty($height) ? preg_replace('/\\s+/', '', $height) : $height;
            $not_loaded_class = $nectar_theme_skin != 'ascend' ? "not-loaded" : null;
            $page_fullscreen_header = get_post_meta($postid, '_nectar_header_fullscreen', true);
            $fullscreen_class = $fullscreen_header == true || $page_fullscreen_header == 'on' ? "fullscreen-header" : null;
            $bottom_shadow_class = $bottom_shadow == 'on' ? " bottom-shadow" : null;
            $bg_overlay_class = $bg_overlay == 'on' ? " bg-overlay" : null;
            $ajax_page_loading = !empty($options['ajax-page-loading']) && $options['ajax-page-loading'] == '1' ? true : false;
            $wrapper_height_style = $fullscreen_header == true && ($post->post_type == 'post' && is_single()) || $ajax_page_loading == false || $page_fullscreen_header == 'on' ? null : 'style="height: ' . $height . 'px;"';
            $midnight_non_parallax = !empty($parallax_bg) && $parallax_bg == 'on' ? null : 'data-midnight="light"';
            if (!empty($parallax_bg) && $parallax_bg == 'on') {
                echo '<div id="page-header-wrap" data-midnight="light" class="' . $fullscreen_class . '" ' . $wrapper_height_style . '>';
            }
            if (!empty($box_roll) && $box_roll == 'on') {
                wp_enqueue_style('box-roll');
                echo '<div class="nectar-box-roll">';
            }
            ?>
	    <div class="<?php 
            echo $not_loaded_class . ' ' . $fullscreen_class . $bottom_shadow_class . $bg_overlay_class;
            ?>
"  id="page-header-bg" <?php 
            echo $midnight_non_parallax;
            ?>
 data-text-effect="<?php 
            echo $text_effect;
            ?>
" data-bg-pos="<?php 
            echo $bg_position;
            ?>
" data-alignment="<?php 
            echo !empty($text_align) ? $text_align : 'left';
            ?>
" data-alignment-v="<?php 
            echo !empty($text_align_v) ? $text_align_v : 'middle';
            ?>
" data-parallax="<?php 
            echo !empty($parallax_bg) && $parallax_bg == 'on' ? '1' : '0';
            ?>
" data-height="<?php 
            echo !empty($height) ? $height : '350';
            ?>
" style="<?php 
            echo $bg_color_string;
            ?>
 background-image: <?php 
            echo nectar_options_img($bg);
            ?>
; height: <?php 
            echo $height;
            ?>
px;">
			

			<?php 
            if ($bg_type != 'particle_bg') {
                echo '<div class="container">';
            }
            if ($post->ID != 0 && $post->post_type && $post->post_type == 'portfolio') {
                ?>
					
					<div class="row project-title">
					<div class="container">
					<div class="col span_6 section-title <?php 
                if (empty($options['portfolio_social']) || $options['portfolio_social'] == 0 || empty($options['portfolio_date']) || $options['portfolio_date'] == 0) {
                    echo 'no-date';
                }
                ?>
">
						
						<h1><?php 
                the_title();
                ?>
</h1>
						
						<?php 
                $options = get_option('salient');
                $back_to_all_override = get_post_meta($post->ID, 'nectar-metabox-portfolio-parent-override', true);
                if (empty($back_to_all_override)) {
                    $back_to_all_override = 'default';
                }
                //attempt to find parent portfolio page - if unsuccessful default to main portfolio page
                global $post;
                $terms = get_the_terms($post->id, "project-type");
                $project_cat = null;
                $portfolio_link = null;
                if (empty($terms)) {
                    $terms = array('1' => (object) array('name' => 'nothing', 'slug' => 'none'));
                }
                foreach ($terms as $term) {
                    $project_cat = strtolower($term->name);
                }
                $page = get_page_by_title_search($project_cat);
                if (empty($page)) {
                    $page = array('0' => (object) array('ID' => 'nothing'));
                }
                $page_link = verify_portfolio_page($page[0]->ID);
                //if a page has been found for the category
                if (!empty($page_link) && $back_to_all_override == 'default') {
                    $portfolio_link = $page_link;
                    ?>
							 
							 <div id="portfolio-nav">
							 	<ul>
							 		<li id="all-items"><a href="<?php 
                    echo $portfolio_link;
                    ?>
"><i class="icon-salient-back-to-all"></i></a></li>               
							 	</ul>
								<ul class="controls">                                 
									<li id="prev-link"><?php 
                    be_next_post_link('%link', '<i class="icon-salient-left-arrow-thin"></i>', TRUE, null, 'project-type');
                    ?>
</li>
									<li id="next-link"><?php 
                    be_previous_post_link('%link', '<i class="icon-salient-right-arrow-thin"></i>', TRUE, null, 'project-type');
                    ?>
</li> 
								</ul>
							</div>
							 
					<?php 
                } else {
                    $portfolio_link = get_portfolio_page_link(get_the_ID());
                    if (!empty($options['main-portfolio-link'])) {
                        $portfolio_link = $options['main-portfolio-link'];
                    }
                    if ($back_to_all_override != 'default') {
                        $portfolio_link = get_page_link($back_to_all_override);
                    }
                    ?>
							
							<div id="portfolio-nav">
								<ul>
									<li id="all-items"><a href="<?php 
                    echo $portfolio_link;
                    ?>
"><i class="icon-salient-back-to-all"></i></a></li>  
								</ul>
								<ul class="controls">                                       
									<?php 
                    if (!empty($options['portfolio_same_category_single_nav']) && $options['portfolio_same_category_single_nav'] == '1') {
                        // get_posts in same custom taxonomy
                        $terms = get_the_terms($post->id, "project-type");
                        $project_cat = null;
                        if (empty($terms)) {
                            $terms = array('1' => (object) array('name' => 'nothing', 'slug' => 'none'));
                        }
                        foreach ($terms as $term) {
                            $project_cat = strtolower($term->slug);
                        }
                        $postlist_args = array('posts_per_page' => -1, 'orderby' => 'menu_order title', 'order' => 'ASC', 'post_type' => 'portfolio', 'project-type' => $project_cat);
                        $postlist = get_posts($postlist_args);
                        // get ids of posts retrieved from get_posts
                        $ids = array();
                        foreach ($postlist as $thepost) {
                            $ids[] = $thepost->ID;
                        }
                        // get and echo previous and next post in the same taxonomy
                        $thisindex = array_search($post->ID, $ids);
                        $previd = isset($ids[$thisindex - 1]) ? $ids[$thisindex - 1] : null;
                        $nextid = isset($ids[$thisindex + 1]) ? $ids[$thisindex + 1] : null;
                        if (!empty($previd)) {
                            echo '<li id="prev-link"><a rel="prev" href="' . get_permalink($previd) . '"><i class="icon-salient-left-arrow-thin"></i></a></li>';
                        }
                        if (!empty($nextid)) {
                            echo '<li id="next-link"><a rel="next" href="' . get_permalink($nextid) . '"><i class="icon-salient-right-arrow-thin"></i></a></li>';
                        }
                        ?>


										<?php 
                    } else {
                        ?>
											<li id="prev-link"><?php 
                        next_post_link('%link', '<i class="icon-salient-left-arrow-thin"></i>');
                        ?>
</li>
											<li id="next-link"><?php 
                        previous_post_link('%link', '<i class="icon-salient-right-arrow-thin"></i>');
                        ?>
</li> 
										<?php 
                    }
                    ?>
								</ul>
							</div>
					 <?php 
                }
                ?>
						
					</div>
				</div> 
			
			</div><!--/row-->
						
						
						
						
						
						
						
					<?php 
            } elseif ($post->ID != 0 && $post->post_type == 'post' && is_single()) {
                // also set as an img for social sharing/
                if ($social_img_src != 'none') {
                    echo '<img class="hidden-social-img" src="' . $social_img_src . '" alt="' . get_the_title() . '" />';
                }
                ?>
						
						<div class="row">
							<div class="col span_6 section-title blog-title">
								<div class="inner-wrap">
									<h1 class="entry-title"><?php 
                the_title();
                ?>
</h1>

									 <?php 
                if ($post->post_type == 'post' && is_single() && $fullscreen_header == true) {
                    ?>
									 	<div class="author-section">
										 	<span class="meta-author vcard author">  
										 		<?php 
                    if (function_exists('get_avatar')) {
                        echo get_avatar(get_the_author_meta('email'), 100);
                    }
                    ?>
										 	</span> 
										 	<div class="avatar-post-info">
											 	<span class="fn"><?php 
                    the_author_posts_link();
                    ?>
</span>
											 	<span class="meta-date date updated"><i><?php 
                    echo get_the_date();
                    ?>
</i></span>
											 </div>
										</div>
								<?php 
                }
                ?>
							
							<?php 
                if ($fullscreen_header != true) {
                    ?>

								<div id="single-below-header">
									<span class="meta-author vcard author"><span class="fn"><?php 
                    echo __('By', NECTAR_THEME_NAME);
                    ?>
 <?php 
                    the_author_posts_link();
                    ?>
</span></span> 
									<?php 
                    if (!empty($options['blog_social']) && $options['blog_social'] == 1) {
                        ?>
										<span class="meta-date date updated"><?php 
                        echo get_the_date();
                        ?>
</span>
									<?php 
                    }
                    ?>
									<span class="meta-category"><?php 
                    the_category(', ');
                    ?>
</span>
									<span class="meta-comment-count"><a href="<?php 
                    comments_link();
                    ?>
"><?php 
                    comments_number(__('No Comments', NECTAR_THEME_NAME), __('One Comment ', NECTAR_THEME_NAME), __('% Comments', NECTAR_THEME_NAME));
                    ?>
</a></span>
								
								</div><!--/single-below-header-->
								
								<div id="single-meta" data-sharing="<?php 
                    echo !empty($options['blog_social']) && $options['blog_social'] == 1 ? '1' : '0';
                    ?>
">
									<ul>
		
										<?php 
                    if (empty($options['blog_social']) || $options['blog_social'] == 0) {
                        ?>
											   	
											   	<li>
											   		<?php 
                        echo '<span class="n-shortcode">' . nectar_love('return') . '</span>';
                        ?>
											   	</li>
												<li>
													<?php 
                        echo get_the_date();
                        ?>
												</li>
										
										<?php 
                    }
                    ?>
			
									</ul>
									
									<?php 
                    if (!empty($options['blog_social']) && $options['blog_social'] == 1) {
                        echo '<div class="nectar-social">';
                        echo '<span class="n-shortcode">' . nectar_love('return') . '</span>';
                        //facebook
                        if (!empty($options['blog-facebook-sharing']) && $options['blog-facebook-sharing'] == 1) {
                            echo "<a class='facebook-share nectar-sharing' href='#' title='" . __('Share this', NECTAR_THEME_NAME) . "'> <i class='icon-facebook'></i> <span class='count'></span></a>";
                        }
                        //twitter
                        if (!empty($options['blog-twitter-sharing']) && $options['blog-twitter-sharing'] == 1) {
                            echo "<a class='twitter-share nectar-sharing' href='#' title='" . __('Tweet this', NECTAR_THEME_NAME) . "'> <i class='icon-twitter'></i> <span class='count'></span></a>";
                        }
                        //google plus
                        if (!empty($options['blog-google-plus-sharing']) && $options['blog-google-plus-sharing'] == 1) {
                            echo "<a class='google-plus-share nectar-sharing-alt' href='#' title='" . __('Share this', NECTAR_THEME_NAME) . "'> <i class='icon-google-plus'></i> <span class='count'> " . GetGooglePlusShares(get_permalink($post->ID)) . " </span></a>";
                        }
                        //linkedIn
                        if (!empty($options['blog-linkedin-sharing']) && $options['blog-linkedin-sharing'] == 1) {
                            echo "<a class='linkedin-share nectar-sharing' href='#' title='" . __('Share this', NECTAR_THEME_NAME) . "'> <i class='icon-linkedin'></i> <span class='count'> </span></a>";
                        }
                        //pinterest
                        if (!empty($options['blog-pinterest-sharing']) && $options['blog-pinterest-sharing'] == 1) {
                            echo "<a class='pinterest-share nectar-sharing' href='#' title='" . __('Pin this', NECTAR_THEME_NAME) . "'> <i class='icon-pinterest'></i> <span class='count'></span></a>";
                        }
                        echo '</div>';
                    }
                    ?>
									
								</div><!--/single-meta-->

							<?php 
                }
                //end if theme skin default
                ?>
						    </div>
						</div><!--/section-title-->
					</div><!--/row-->
						
							
						
						
					
					<?php 
                //default
            } else {
                if ($bg_type != 'particle_bg') {
                    if (!empty($box_roll) && $box_roll == 'on') {
                        $alignment = !empty($text_align) ? $text_align : 'left';
                        $v_alignment = !empty($text_align_v) ? $text_align_v : 'middle';
                        echo '<div class="overlaid-content" data-text-effect="' . $text_effect . '" data-alignment="' . $alignment . '" data-alignment-v="' . $v_alignment . '"><div class="container">';
                    }
                    ?>

						 <div class="row">
							<div class="col span_6">
								<div class="inner-wrap">
									<h1><?php 
                    echo $title;
                    ?>
</h1>
									<span class="subheader"><?php 
                    echo $subtitle;
                    ?>
</span>
								</div>
								 
								<?php 
                    // portfolio filters
                    if ($page_template == 'template-portfolio.php' && $display_sortable == '1' && $inline_filters == '0') {
                        ?>
									<div class="<?php 
                        echo $filters_id;
                        ?>
" instance="0">
											<a href="#" data-sortable-label="<?php 
                        echo !empty($options['portfolio-sortable-text']) ? $options['portfolio-sortable-text'] : 'Sort Portfolio';
                        ?>
" id="sort-portfolio"><span><?php 
                        echo !empty($options['portfolio-sortable-text']) ? $options['portfolio-sortable-text'] : __('Sort Portfolio', NECTAR_THEME_NAME);
                        ?>
</span> <i class="icon-angle-down"></i></a> 
										<ul>
										   <li><a href="#" data-filter="*"><?php 
                        echo __('All', NECTAR_THEME_NAME);
                        ?>
</a></li>
						               	   <?php 
                        wp_list_categories(array('title_li' => '', 'taxonomy' => 'project-type', 'show_option_none' => '', 'walker' => new Walker_Portfolio_Filter()));
                        ?>
										</ul>
									</div>
								<?php 
                    }
                    ?>
								</div>
						  </div>
					  
					  <?php 
                    if (!empty($box_roll) && $box_roll == 'on') {
                        echo '</div></div><!--/overlaid-content-->';
                    }
                }
            }
            ?>
					
					
				
			<?php 
            if ($bg_type != 'particle_bg') {
                echo '</div>';
            }
            //closing container
            if ($post->ID != 0 && $post->post_type == 'post' && is_single() && $fullscreen_header == true || $page_fullscreen_header == 'on') {
                $rotate_in_class = $text_effect == 'rotate_in' ? 'hidden' : null;
                $button_styling = !empty($options['button-styling']) ? $options['button-styling'] : 'default';
                if ($button_styling == 'default') {
                    echo '<div class="scroll-down-wrap"><a href="#" class="section-down-arrow ' . $rotate_in_class . '"><i class="icon-salient-down-arrow icon-default-style"> </i></a></div>';
                } else {
                    echo '<div class="scroll-down-wrap ' . $rotate_in_class . '"><a href="#" class="section-down-arrow"><i class="fa fa-angle-down top"></i><i class="fa fa-angle-down"></i></a></div>';
                }
            }
            //video bg
            if ($bg_type == 'video_bg') {
                if (floatval(get_bloginfo('version')) >= "3.6") {
                    wp_enqueue_script('wp-mediaelement');
                    wp_enqueue_style('wp-mediaelement');
                } else {
                    //register media element for WordPress 3.5
                    wp_register_script('wp-mediaelement', get_template_directory_uri() . '/js/mediaelement-and-player.min.js', array('jquery'), '1.0', TRUE);
                    wp_register_style('wp-mediaelement', get_template_directory_uri() . '/css/mediaelementplayer.min.css');
                    wp_enqueue_script('wp-mediaelement');
                    wp_enqueue_style('wp-mediaelement');
                }
                //parse video image
                if (strpos($video_image, "http://") !== false) {
                    $video_image_src = $video_image;
                } else {
                    $video_image_src = wp_get_attachment_image_src($video_image, 'full');
                    $video_image_src = $video_image_src[0];
                }
                //$poster_markup = (!empty($video_image)) ? 'poster="'.$video_image_src.'"' : null ;
                $poster_markup = null;
                $video_markup = null;
                $video_markup .= '<div class="video-color-overlay" data-color="' . $bg_color . '"></div>';
                $video_markup .= '
			
			<div class="mobile-video-image" style="background-image: url(' . $video_image_src . ')"></div>
			<div class="nectar-video-wrap" data-bg-alignment="' . $bg_position . '">
				
				
				<video class="nectar-video-bg" width="1800" height="700" ' . $poster_markup . '  preload="auto" loop autoplay>';
                if (!empty($video_webm)) {
                    $video_markup .= '<source type="video/webm" src="' . $video_webm . '">';
                }
                if (!empty($video_mp4)) {
                    $video_markup .= '<source type="video/mp4" src="' . $video_mp4 . '">';
                }
                if (!empty($video_ogv)) {
                    $video_markup .= '<source type="video/ogg" src="' . $video_ogv . '">';
                }
                $video_markup .= '</video>
		
			</div>';
                echo $video_markup;
            }
            //particle bg
            if ($bg_type == 'particle_bg') {
                wp_enqueue_script('nectarParticles');
                echo '<div class=" nectar-particles" data-disable-explosion="' . $disable_explosion . '" data-rotation-timing="' . $rotate_timing . '"><div class="canvas-bg"><canvas id="canvas" data-active-index="0"></canvas></div>';
                $images = explode(',', $shapes);
                $i = 0;
                if (!empty($shapes)) {
                    if (!empty($box_roll) && $box_roll == 'on') {
                        $alignment = !empty($text_align) ? $text_align : 'left';
                        $v_alignment = !empty($text_align_v) ? $text_align_v : 'middle';
                        echo '<div class="overlaid-content" data-text-effect="' . $text_effect . '" data-alignment="' . $alignment . '" data-alignment-v="' . $v_alignment . '">';
                    }
                    echo '<div class="container"><div class="row"><div class="col span_6" >';
                    foreach ($images as $attach_id) {
                        $i++;
                        $img = wp_get_attachment_image_src($attach_id, 'full');
                        $attachment = get_post($attach_id);
                        $shape_meta = array('caption' => $attachment->post_excerpt, 'title' => $attachment->post_title, 'bg_color' => get_post_meta($attachment->ID, 'nectar_particle_shape_bg_color', true), 'color' => get_post_meta($attachment->ID, 'nectar_particle_shape_color', true), 'color_mapping' => get_post_meta($attachment->ID, 'nectar_particle_shape_color_mapping', true), 'alpha' => get_post_meta($attachment->ID, 'nectar_particle_shape_color_alpha', true), 'density' => get_post_meta($attachment->ID, 'nectar_particle_shape_density', true), 'max_particle_size' => get_post_meta($attachment->ID, 'nectar_particle_max_particle_size', true));
                        if (!empty($shape_meta['density'])) {
                            switch ($shape_meta['density']) {
                                case 'very_low':
                                    $shape_meta['density'] = '19';
                                    break;
                                case 'low':
                                    $shape_meta['density'] = '16';
                                    break;
                                case 'medium':
                                    $shape_meta['density'] = '13';
                                    break;
                                case 'high':
                                    $shape_meta['density'] = '10';
                                    break;
                                case 'very_high':
                                    $shape_meta['density'] = '8';
                                    break;
                            }
                        }
                        if (!empty($shape_meta['color']) && $shape_meta['color'] == '#fff' || !empty($shape_meta['color']) && $shape_meta['color'] == '#ffffff') {
                            $shape_meta['color'] = '#fefefe';
                        }
                        //data for particle shape
                        echo '<div class="shape" data-src="' . $img[0] . '" data-max-size="' . $shape_meta['max_particle_size'] . '" data-alpha="' . $shape_meta['alpha'] . '" data-density="' . $shape_meta['density'] . '" data-color-mapping="' . $shape_meta['color_mapping'] . '" data-color="' . $shape_meta['color'] . '" data-bg-color="' . $shape_meta['bg_color'] . '"></div>';
                        //overlaid content
                        echo '<div class="inner-wrap shape-' . $i . '">';
                        echo '<h1>' . $shape_meta["title"] . '</h1> <span class="subheader">' . $shape_meta["caption"] . '</span>';
                        echo '</div>';
                    }
                    ?>

	    		</div></div></div>

	    		<div class="pagination-navigation">
					<div class="pagination-current"></div>
					<div class="pagination-dots">
						<?php 
                    foreach ($images as $attach_id) {
                        echo '<button class="pagination-dot"></button>';
                    }
                    ?>
					</div>
				</div>
				<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="690">
				  <defs>
				    <filter id="goo">
				      <feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur"></feGaussianBlur>
				      <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 69 -16" result="goo"></feColorMatrix>
				      <feComposite in="SourceGraphic" in2="goo" operator="atop"></feComposite>
				    </filter>
				  </defs>
				</svg>

				<?php 
                    if (!empty($box_roll) && $box_roll == 'on') {
                        echo '</div><!--/overlaid-content-->';
                    }
                    ?>

			</div> <!--/nectar particles-->

			<?php 
                }
            }
            //particle bg
            ?>

		</div>

	   <?php 
            if (!empty($parallax_bg) && $parallax_bg == 'on' || !empty($box_roll) && $box_roll == 'on') {
                echo '</div>';
            }
            ?>

	    <?php 
        } else {
            if (!empty($title)) {
                ?>
	    	
		    <div class="row page-header-no-bg" data-alignment="<?php 
                echo !empty($text_align) ? $text_align : 'left';
                ?>
">
		    	<div class="container">	
					<div class="col span_12 section-title">
						<h1><?php 
                echo $title;
                if (!empty($subtitle)) {
                    echo '<span>' . $subtitle . '</span>';
                }
                ?>
</h1>
						
						<?php 
                // portfolio filters
                if ($page_template == 'template-portfolio.php' && $display_sortable == '1' && $inline_filters == '0') {
                    ?>
						<div class="<?php 
                    echo $filters_id;
                    ?>
" instance="0">
							
							<a href="#" data-sortable-label="<?php 
                    echo !empty($options['portfolio-sortable-text']) ? $options['portfolio-sortable-text'] : 'Sort Portfolio';
                    ?>
" id="sort-portfolio"><span><?php 
                    echo !empty($options['portfolio-sortable-text']) ? $options['portfolio-sortable-text'] : __('Sort Portfolio', NECTAR_THEME_NAME);
                    ?>
</span> <i class="icon-angle-down"></i></a> 
							
							<ul>
							   <li><a href="#" data-filter="*"><?php 
                    echo __('All', NECTAR_THEME_NAME);
                    ?>
</a></li>
			               	   <?php 
                    wp_list_categories(array('title_li' => '', 'taxonomy' => 'project-type', 'show_option_none' => '', 'walker' => new Walker_Portfolio_Filter()));
                    ?>
							</ul>
						</div>
					<?php 
                }
                ?>
						
					</div>
				</div>

			</div> 
	 	   	
	    <?php 
            }
        }
    }
Example #18
0
function colabs_post_meta()
{
    global $post;
    ?>
			  <li class="entry-author"><i class="icon-user" ></i>
                <?php 
    the_author_posts_link();
    ?>
				<div class="author-description">
				  <?php 
    echo get_avatar(get_the_author_meta('ID'), 45);
    ?>
				  <p><?php 
    echo get_the_author_meta('description');
    ?>
</p>
				</div>				
              </li>
              <li class="entry-date"><i class="icon-time" ></i><time><?php 
    the_time(get_option('date_format'));
    ?>
</time></li>
              <li class="entry-comment-count"><i class="icon-comment" ></i><a href="<?php 
    comments_link();
    ?>
"><?php 
    comments_number(__('Add Comment', 'colabsthemes'), __('1 Comment', 'colabsthemes'), __('% Comments', 'colabsthemes'));
    ?>
</a></li>
              
			  <?php 
    echo get_the_term_list($post->ID, 'photograph-categories', '<li class="entry-tags"><i class="icon-tags" ></i>', ', ', '</li>');
    ?>
			  <?php 
    echo get_the_term_list($post->ID, 'post_tag', '<li class="entry-tags"><i class="icon-tags" ></i>', ', ', '</li>');
    ?>
			  
<?php 
}
Example #19
0
/**
 * Prints the necessary markup for the embed comments button.
 *
 * @since 4.4.0
 */
function print_embed_comments_button()
{
    if (is_404() || !(get_comments_number() || comments_open())) {
        return;
    }
    ?>
	<div class="wp-embed-comments">
		<a href="<?php 
    comments_link();
    ?>
" target="_top">
			<span class="dashicons dashicons-admin-comments"></span>
			<?php 
    printf(_n('%s <span class="screen-reader-text">Comment</span>', '%s <span class="screen-reader-text">Comments</span>', get_comments_number()), number_format_i18n(get_comments_number()));
    ?>
		</a>
	</div>
	<?php 
}
Example #20
0
    function vw_the_comment_link()
    {
        ?>

		<a href="<?php 
        comments_link();
        ?>
" class="vw-post-comment-number"><i class="icon-entypo-chat"></i> <span><?php 
        comments_number(__('0', 'envirra'), __('1', 'envirra'), __('%', 'envirra'));
        ?>
</span></a>
		<?php 
    }
/**
 * comments_popup_link() - Displays the link to the comments popup window for the current post ID.
 *
 * Is not meant to be displayed on single posts and pages. Should be used on the lists of posts
 *
 * @since 0.71
 * @uses $id
 * @uses $wpcommentspopupfile
 * @uses $wpcommentsjavascript
 * @uses $post
 *
 * @param string $zero The string to display when no comments
 * @param string $one The string to display when only one comment is available
 * @param string $more The string to display when there are more than one comment
 * @param string $css_class The CSS class to use for comments
 * @param string $none The string to display when comments have been turned off
 * @return null Returns null on single posts and pages.
 */
function comments_popup_link($zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $css_class = '', $none = 'Comments Off')
{
    global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post;
    if (is_single() || is_page()) {
        return;
    }
    $number = get_comments_number($id);
    if (0 == $number && 'closed' == $post->comment_status && 'closed' == $post->ping_status) {
        echo '<span' . (!empty($css_class) ? ' class="' . $css_class . '"' : '') . '>' . $none . '</span>';
        return;
    }
    if (!empty($post->post_password)) {
        // if there's a password
        if (!isset($_COOKIE['wp-postpass_' . COOKIEHASH]) || $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {
            // and it doesn't match the cookie
            echo __('Enter your password to view comments');
            return;
        }
    }
    echo '<a href="';
    if ($wpcommentsjavascript) {
        if (empty($wpcommentspopupfile)) {
            $home = get_option('home');
        } else {
            $home = get_option('siteurl');
        }
        echo $home . '/' . $wpcommentspopupfile . '?comments_popup=' . $id;
        echo '" onclick="wpopen(this.href); return false"';
    } else {
        // if comments_popup_script() is not in the template, display simple comment link
        if (0 == $number) {
            echo get_permalink() . '#respond';
        } else {
            comments_link();
        }
        echo '"';
    }
    if (!empty($css_class)) {
        echo ' class="' . $css_class . '" ';
    }
    $title = attribute_escape(get_the_title());
    echo apply_filters('comments_popup_link_attributes', '');
    echo ' title="' . sprintf(__('Comment on %s'), $title) . '">';
    comments_number($zero, $one, $more, $number);
    echo '</a>';
}
Example #22
0
function ceo_display_comic_navigation()
{
    global $post, $wp_query;
    if (ceo_pluginfo('navigate_only_chapters')) {
        $first_comic = ceo_get_first_comic_in_chapter_permalink();
        $last_comic = ceo_get_last_comic_in_chapter_permalink();
        $next_comic = ceo_get_next_comic_in_chapter_permalink();
        $prev_comic = ceo_get_previous_comic_in_chapter_permalink();
    } else {
        $first_comic = ceo_get_first_comic_permalink();
        $last_comic = ceo_get_last_comic_permalink();
        $next_comic = ceo_get_next_comic_permalink();
        $prev_comic = ceo_get_previous_comic_permalink();
    }
    $first_text = __('&lsaquo;&lsaquo; First', 'comiceasel');
    $last_text = __('Last &rsaquo;&rsaquo;', 'comiceasel');
    $next_text = __('Next &rsaquo;', 'comiceasel');
    $prev_text = __('&lsaquo; Prev', 'comiceasel');
    ?>
	<table id="comic-nav-wrapper">
		<tr class="comic-nav-container">
			<td class="comic-nav"><?php 
    if (get_permalink() != $first_comic) {
        ?>
<a href="<?php 
        echo $first_comic;
        ?>
" class="comic-nav-base comic-nav-first<?php 
        if (get_permalink() == $first_comic) {
            ?>
 comic-nav-inactive<?php 
        }
        ?>
"><?php 
        echo $first_text;
        ?>
</a><?php 
    } else {
        echo '<span class="comic-nav-base comic-nav-first comic-nav-void">' . $first_text . '</span>';
    }
    ?>
</td>
			<td class="comic-nav"><?php 
    if ($prev_comic) {
        ?>
<a href="<?php 
        echo $prev_comic;
        ?>
" class="comic-nav-base comic-nav-previous<?php 
        if (!$prev_comic) {
            ?>
 comic-nav-inactive<?php 
        }
        ?>
"><?php 
        echo $prev_text;
        ?>
</a><?php 
    } else {
        echo '<span class="comic-nav-base comic-nav-previous comic-nav-void ">' . $prev_text . '</span>';
    }
    ?>
</td>
<?php 
    if (ceo_pluginfo('enable_buy_comic') && !wp_is_mobile()) {
        if (strpos(ceo_pluginfo('buy_comic_url'), '?') !== false) {
            $bpsep = '&';
        } else {
            $bpsep = '?';
        }
        ?>
		<td class="comic-nav"><a href="<?php 
        echo ceo_pluginfo('buy_comic_url') . $bpsep . 'id=' . $post->ID;
        ?>
" class="comic-nav-base comic-nav-buycomic" title="Buy Comic"><?php 
        _e('Buy!', 'comiceasel');
        ?>
</a></td>
<?php 
    }
    if (ceo_pluginfo('enable_comment_nav') && !wp_is_mobile()) {
        $commentscount = get_comments_number();
        ?>
			<td class="comic-nav"><a href="<?php 
        comments_link();
        ?>
" class="comic-nav-comments" title="<?php 
        the_title();
        ?>
"><span class="comic-nav-comment-count"><?php 
        echo sprintf(_n('Comment(%d)', 'Comments(%d)', $commentscount, 'comiceasel'), $commentscount);
        ?>
</span></a></td>
<?php 
    }
    if (ceo_pluginfo('enable_random_nav') && !wp_is_mobile()) {
        $stay = '';
        if (ceo_pluginfo('enable_chapter_only_random')) {
            $chapter = get_the_terms($post->ID, 'chapters');
            if (!empty($chapter) && !is_wp_error($chapter)) {
                $stay = '&stay=' . reset($chapter)->term_id;
            }
        }
        ?>
			<td class="comic-nav"><a href="<?php 
        bloginfo('url');
        ?>
?random&nocache=1<?php 
        echo $stay;
        ?>
" class="comic-nav-random" title="Random Comic"><?php 
        _e('Random', 'comiceasel');
        ?>
</a></td>
<?php 
    }
    ?>
	<td class="comic-nav"><?php 
    if ($next_comic) {
        ?>
<a href="<?php 
        echo $next_comic;
        ?>
" class="comic-nav-base comic-nav-next<?php 
        if (!$next_comic) {
            ?>
 comic-nav-inactive<?php 
        }
        ?>
"><?php 
        echo $next_text;
        ?>
</a><?php 
    } else {
        echo '<span class="comic-nav-base comic-nav-next comic-nav-void ">' . $next_text . '</span>';
    }
    ?>
</td>
	<td class="comic-nav"><?php 
    if (get_permalink() != $last_comic) {
        ?>
<a href="<?php 
        echo $last_comic;
        ?>
" class="comic-nav-base comic-nav-last<?php 
        if (get_permalink() == $last_comic) {
            ?>
 comic-nav-inactive<?php 
        }
        ?>
"><?php 
        echo $last_text;
        ?>
</a><?php 
    } else {
        echo '<span class="comic-nav-base comic-nav-last comic-nav-void ">' . $last_text . '</span>';
    }
    ?>
</td>
<?php 
    if (ceo_pluginfo('enable_chapter_nav')) {
        ?>
				
			<td class="comic-nav comic-nav-jumpto"><?php 
        ceo_comic_archive_jump_to_chapter(true, '', false, ceo_pluginfo('default_nav_bar_chapter_goes_to_archive'));
        ?>
</td>
<?php 
    }
    if (ceo_pluginfo('enable_comic_nav')) {
        ?>
				
			<td class="comic-nav comic-nav-jumptocomic"><?php 
        ceo_list_jump_to_comic();
        ?>
</td>
<?php 
    }
    ?>
		</tr>
<?php 
    if (ceo_pluginfo('enable_embed_nav') && !wp_is_mobile()) {
        ?>
		<tr>
			<td class="comic-nav" colspan="15">
				<?php 
        $post_image_id = get_post_thumbnail_id($post->ID);
        $thumbnail = wp_get_attachment_image_src($post_image_id, 'full', false);
        if (is_array($thumbnail)) {
            $thumbnail = reset($thumbnail);
            echo $thumbnail;
        }
        ?>
			</td>
		</tr>
<?php 
    }
    ?>
 
	</table>
	<?php 
}
function comments_popup_link($zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $CSSclass = '', $none = 'Comments Off')
{
    global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post, $wpdb;
    global $comment_count_cache;
    if (!is_single() && !is_page()) {
        if (!isset($comment_count_cache[$id])) {
            $comment_count_cache[$id] = $wpdb->get_var("SELECT COUNT(comment_ID) FROM {$wpdb->comments} WHERE comment_post_ID = {$id} AND comment_approved = '1';");
        }
        $number = $comment_count_cache[$id];
        if (0 == $number && 'closed' == $post->comment_status && 'closed' == $post->ping_status) {
            echo $none;
            return;
        } else {
            if (!empty($post->post_password)) {
                // if there's a password
                if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {
                    // and it doesn't match the cookie
                    echo 'Enter your password to view comments';
                    return;
                }
            }
            echo '<a href="';
            if ($wpcommentsjavascript) {
                if (empty($wpcommentspopupfile)) {
                    $home = get_settings('home');
                } else {
                    $home = get_settings('siteurl');
                }
                echo $home . '/' . $wpcommentspopupfile . '?comments_popup=' . $id;
                echo '" onclick="wpopen(this.href); return false"';
            } else {
                // if comments_popup_script() is not in the template, display simple comment link
                if (0 == $number) {
                    echo get_permalink() . '#respond';
                } else {
                    comments_link();
                }
                echo '"';
            }
            if (!empty($CSSclass)) {
                echo ' class="' . $CSSclass . '"';
            }
            echo ' title="' . sprintf(__('Comment on %s'), $post->post_title) . '">';
            comments_number($zero, $one, $more, $number);
            echo '</a>';
        }
    }
}
Example #24
0
    function nectar_page_header($postid)
    {
        global $options;
        global $post;
        global $nectar_theme_skin;
        $bg = get_post_meta($postid, '_nectar_header_bg', true);
        $bg_color = get_post_meta($postid, '_nectar_header_bg_color', true);
        $font_color = get_post_meta($postid, '_nectar_header_font_color', true);
        $parallax_bg = get_post_meta($postid, '_nectar_header_parallax', true);
        $title = get_post_meta($postid, '_nectar_header_title', true);
        $subtitle = get_post_meta($postid, '_nectar_header_subtitle', true);
        $height = get_post_meta($postid, '_nectar_header_bg_height', true);
        $page_template = get_post_meta($postid, '_wp_page_template', true);
        $display_sortable = get_post_meta($postid, 'nectar-metabox-portfolio-display-sortable', true);
        $inline_filters = !empty($options['portfolio_inline_filters']) && $options['portfolio_inline_filters'] == '1' ? '1' : '0';
        $filters_id = !empty($options['portfolio_inline_filters']) && $options['portfolio_inline_filters'] == '1' ? 'portfolio-filters-inline' : 'portfolio-filters';
        $text_align = get_post_meta($postid, '_nectar_page_header_alignment', true);
        $fullscreen_header = !empty($options['blog_header_type']) && $options['blog_header_type'] == 'fullscreen' && is_singular('post') ? true : false;
        $bottom_shadow = get_post_meta($postid, '_nectar_header_bottom_shadow', true);
        $bg_overlay = get_post_meta($postid, '_nectar_header_overlay', true);
        !empty($display_sortable) && $display_sortable == 'on' ? $display_sortable = '1' : ($display_sortable = '0');
        //incase no title is entered for portfolio, still show the filters
        if ($page_template == 'template-portfolio.php' && empty($title)) {
            $title = get_the_title($post->ID);
        }
        if (!empty($bg) || !empty($bg_color)) {
            empty($bg) ? $social_img_src = 'none' : ($social_img_src = $bg);
            empty($bg) ? $bg = 'none' : ($bg = 'url(' . $bg . ')');
            empty($bg_color) ? $bg_color = '#000' : ($bg_color = $bg_color);
            $height = !empty($height) ? preg_replace('/\\s+/', '', $height) : $height;
            $not_loaded_class = $nectar_theme_skin != 'ascend' ? "not-loaded" : null;
            $fullscreen_class = $fullscreen_header == true ? "fullscreen-header" : null;
            $bottom_shadow_class = $bottom_shadow == 'on' ? " bottom-shadow" : null;
            $bg_overlay_class = $bg_overlay == 'on' ? " bg-overlay" : null;
            $ajax_page_loading = !empty($options['ajax-page-loading']) && $options['ajax-page-loading'] == '1' ? true : false;
            $wrapper_height_style = $fullscreen_header == true && ($post->post_type == 'post' && is_single()) || $ajax_page_loading == false ? null : 'style="height: ' . $height . 'px;"';
            if (!empty($parallax_bg) && $parallax_bg == 'on') {
                echo '<div id="page-header-wrap" class="' . $fullscreen_class . '" ' . $wrapper_height_style . '>';
            }
            ?>
	    <div class="<?php 
            echo $not_loaded_class . ' ' . $fullscreen_class . $bottom_shadow_class . $bg_overlay_class;
            ?>
" id="page-header-bg" data-alignment="<?php 
            echo !empty($text_align) ? $text_align : 'left';
            ?>
" data-parallax="<?php 
            echo !empty($parallax_bg) && $parallax_bg == 'on' ? '1' : '0';
            ?>
" data-height="<?php 
            echo !empty($height) ? $height : '350';
            ?>
" style="background-color: <?php 
            echo $bg_color;
            ?>
; background-image: <?php 
            echo nectar_options_img($bg);
            ?>
; height: <?php 
            echo $height;
            ?>
px;">
			

			<div class="container">	
			
					<?php 
            if ($post->ID != 0 && $post->post_type && $post->post_type == 'portfolio') {
                ?>
					
					<div class="row project-title">
					<div class="container">
					<div class="col span_6 section-title <?php 
                if (empty($options['portfolio_social']) || $options['portfolio_social'] == 0 || empty($options['portfolio_date']) || $options['portfolio_date'] == 0) {
                    echo 'no-date';
                }
                ?>
">
						
						<h1><?php 
                the_title();
                ?>
</h1>
						
						<?php 
                $options = get_option('salient');
                $back_to_all_override = get_post_meta($post->ID, 'nectar-metabox-portfolio-parent-override', true);
                if (empty($back_to_all_override)) {
                    $back_to_all_override = 'default';
                }
                //attempt to find parent portfolio page - if unsuccessful default to main portfolio page
                global $post;
                $terms = get_the_terms($post->id, "project-type");
                $project_cat = null;
                $portfolio_link = null;
                if (empty($terms)) {
                    $terms = array('1' => (object) array('name' => 'nothing'));
                }
                foreach ($terms as $term) {
                    $project_cat = strtolower($term->name);
                }
                $page = get_page_by_title_search($project_cat);
                if (empty($page)) {
                    $page = array('0' => (object) array('ID' => 'nothing'));
                }
                $page_link = verify_portfolio_page($page[0]->ID);
                //if a page has been found for the category
                if (!empty($page_link) && $back_to_all_override == 'default') {
                    $portfolio_link = $page_link;
                    ?>
							 
							 <div id="portfolio-nav">
							 	<ul>
							 		<li id="all-items"><a href="<?php 
                    echo $portfolio_link;
                    ?>
"><i class="icon-salient-back-to-all"></i></a></li>               
							 	</ul>
								<ul class="controls">                                 
									<li id="prev-link"><?php 
                    be_next_post_link('%link', '<i class="icon-salient-left-arrow-thin"></i>', TRUE, null, 'project-type');
                    ?>
</li>
									<li id="next-link"><?php 
                    be_previous_post_link('%link', '<i class="icon-salient-right-arrow-thin"></i>', TRUE, null, 'project-type');
                    ?>
</li> 
								</ul>
							</div>
							 
					<?php 
                } else {
                    $portfolio_link = get_portfolio_page_link(get_the_ID());
                    if (!empty($options['main-portfolio-link'])) {
                        $portfolio_link = $options['main-portfolio-link'];
                    }
                    if ($back_to_all_override != 'default') {
                        $portfolio_link = get_page_link($back_to_all_override);
                    }
                    ?>
							
							<div id="portfolio-nav">
								<ul>
									<li id="all-items"><a href="<?php 
                    echo $portfolio_link;
                    ?>
"><i class="icon-salient-back-to-all"></i></a></li>  
								</ul>
								<ul class="controls">                                       
									<?php 
                    if (!empty($options['portfolio_same_category_single_nav']) && $options['portfolio_same_category_single_nav'] == '1') {
                        ?>
											<li id="prev-link"><?php 
                        be_next_post_link('%link', '<i class="icon-salient-left-arrow-thin"></i>');
                        ?>
</li>
											<li id="next-link"><?php 
                        be_previous_post_link('%link', '<i class="icon-salient-right-arrow-thin"></i>');
                        ?>
</li> 
										<?php 
                    } else {
                        ?>
											<li id="prev-link"><?php 
                        next_post_link('%link', '<i class="icon-salient-left-arrow-thin"></i>');
                        ?>
</li>
											<li id="next-link"><?php 
                        previous_post_link('%link', '<i class="icon-salient-right-arrow-thin"></i>');
                        ?>
</li> 
										<?php 
                    }
                    ?>
								</ul>
							</div>
					 <?php 
                }
                ?>
						
					</div>
				</div> 
			
			</div><!--/row-->
						
						
						
						
						
						
						
					<?php 
            } elseif ($post->ID != 0 && $post->post_type == 'post' && is_single()) {
                // also set as an img for social sharing/
                if ($social_img_src != 'none') {
                    echo '<img class="hidden-social-img" src="' . $social_img_src . '" alt="' . get_the_title() . '" />';
                }
                ?>
						
						<div class="row">
						<div class="col span_6 section-title blog-title">
							<h1 class="entry-title"><?php 
                the_title();
                ?>
</h1>

							 <?php 
                if ($post->post_type == 'post' && is_single() && $fullscreen_header == true) {
                    ?>
							 	<div class="author-section">
								 	<span class="meta-author vcard author">  
								 		<?php 
                    if (function_exists('get_avatar')) {
                        echo get_avatar(get_the_author_meta('email'), 100);
                    }
                    ?>
								 	</span> 
								 	<div class="avatar-post-info">
									 	<span class="fn"><?php 
                    the_author_posts_link();
                    ?>
</span>
									 	<span class="meta-date date updated"><i><?php 
                    echo get_the_date();
                    ?>
</i></span>
									 </div>
								</div>
							<?php 
                }
                ?>
							
							<?php 
                if ($fullscreen_header != true) {
                    ?>

								<div id="single-below-header">
									<span class="meta-author vcard author"><span class="fn"><?php 
                    echo __('By', NECTAR_THEME_NAME);
                    ?>
 <?php 
                    the_author_posts_link();
                    ?>
</span></span> 
									<?php 
                    if (!empty($options['blog_social']) && $options['blog_social'] == 1) {
                        ?>
										<span class="meta-date date updated"><?php 
                        echo get_the_date();
                        ?>
</span>
									<?php 
                    }
                    ?>
									<span class="meta-category"><?php 
                    the_category(', ');
                    ?>
</span>
									<span class="meta-comment-count"><a href="<?php 
                    comments_link();
                    ?>
"><?php 
                    comments_number(__('No Comments', NECTAR_THEME_NAME), __('One Comment ', NECTAR_THEME_NAME), __('% Comments', NECTAR_THEME_NAME));
                    ?>
</a></span>
								
								</div><!--/single-below-header-->
								
								<div id="single-meta" data-sharing="<?php 
                    echo !empty($options['blog_social']) && $options['blog_social'] == 1 ? '1' : '0';
                    ?>
">
									<ul>
		
										<?php 
                    if (empty($options['blog_social']) || $options['blog_social'] == 0) {
                        ?>
											   	
											   	<li>
											   		<?php 
                        echo '<span class="n-shortcode">' . nectar_love('return') . '</span>';
                        ?>
											   	</li>
												<li>
													<?php 
                        echo get_the_date();
                        ?>
												</li>
										
										<?php 
                    }
                    ?>
			
									</ul>
									
									<?php 
                    if (!empty($options['blog_social']) && $options['blog_social'] == 1) {
                        echo '<div class="nectar-social">';
                        echo '<span class="n-shortcode">' . nectar_love('return') . '</span>';
                        //facebook
                        if (!empty($options['blog-facebook-sharing']) && $options['blog-facebook-sharing'] == 1) {
                            echo "<a class='facebook-share nectar-sharing' href='#' title='" . __('Share this', NECTAR_THEME_NAME) . "'> <i class='icon-facebook'></i> <span class='count'></span></a>";
                        }
                        //twitter
                        if (!empty($options['blog-twitter-sharing']) && $options['blog-twitter-sharing'] == 1) {
                            echo "<a class='twitter-share nectar-sharing' href='#' title='" . __('Tweet this', NECTAR_THEME_NAME) . "'> <i class='icon-twitter'></i> <span class='count'></span></a>";
                        }
                        //google plus
                        if (!empty($options['blog-google-plus-sharing']) && $options['blog-google-plus-sharing'] == 1) {
                            echo "<a class='google-plus-share nectar-sharing-alt' href='#' title='" . __('Share this', NECTAR_THEME_NAME) . "'> <i class='icon-google-plus'></i> <span class='count'> " . GetGooglePlusShares(get_permalink($post->ID)) . " </span></a>";
                        }
                        //linkedIn
                        if (!empty($options['blog-linkedin-sharing']) && $options['blog-linkedin-sharing'] == 1) {
                            echo "<a class='linkedin-share nectar-sharing' href='#' title='" . __('Share this', NECTAR_THEME_NAME) . "'> <i class='icon-linkedin'></i> <span class='count'> </span></a>";
                        }
                        //pinterest
                        if (!empty($options['blog-pinterest-sharing']) && $options['blog-pinterest-sharing'] == 1) {
                            echo "<a class='pinterest-share nectar-sharing' href='#' title='" . __('Pin this', NECTAR_THEME_NAME) . "'> <i class='icon-pinterest'></i> <span class='count'></span></a>";
                        }
                        echo '</div>';
                    }
                    ?>
									
								</div><!--/single-meta-->

							<?php 
                }
                //end if theme skin default
                ?>

						</div><!--/section-title-->
					</div><!--/row-->
						
							
						
						
					
					<?php 
                //default
            } else {
                ?>
					 <div class="row">
						<div class="col span_6">
							<h1><?php 
                echo $title;
                ?>
</h1>
							<span class="subheader"><?php 
                echo $subtitle;
                ?>
</span>
						</div>
						 
						<?php 
                // portfolio filters
                if ($page_template == 'template-portfolio.php' && $display_sortable == '1' && $inline_filters == '0') {
                    ?>
							<div id="<?php 
                    echo $filters_id;
                    ?>
">
									<a href="#" data-sortable-label="<?php 
                    echo !empty($options['portfolio-sortable-text']) ? $options['portfolio-sortable-text'] : 'Sort Portfolio';
                    ?>
" id="sort-portfolio"><span><?php 
                    echo !empty($options['portfolio-sortable-text']) ? $options['portfolio-sortable-text'] : __('Sort Portfolio', NECTAR_THEME_NAME);
                    ?>
</span> <i class="icon-angle-down"></i></a> 
								<ul>
								   <li><a href="#" data-filter="*"><?php 
                    echo __('All', NECTAR_THEME_NAME);
                    ?>
</a></li>
				               	   <?php 
                    wp_list_categories(array('title_li' => '', 'taxonomy' => 'project-type', 'show_option_none' => '', 'walker' => new Walker_Portfolio_Filter()));
                    ?>
								</ul>
							</div>
						<?php 
                }
                ?>
						
					  </div>
					  
					  
				<?php 
            }
            ?>
					
					
				
			</div>


			 <?php 
            if ($post->ID != 0 && $post->post_type == 'post' && is_single() && $fullscreen_header == true) {
                ?>
				<a href="#" class="section-down-arrow"><i class="icon-salient-down-arrow icon-default-style"> </i></a>
			<?php 
            }
            ?>


		</div>


	   <?php 
            if (!empty($parallax_bg) && $parallax_bg == 'on') {
                echo '</div>';
            }
            ?>


	    <?php 
        } else {
            if (!empty($title)) {
                ?>
	    	
		    <div class="row page-header-no-bg" data-alignment="<?php 
                echo !empty($text_align) ? $text_align : 'left';
                ?>
">
		    	<div class="container">	
					<div class="col span_12 section-title">
						<h1><?php 
                echo $title;
                if (!empty($subtitle)) {
                    echo '<span>' . $subtitle . '</span>';
                }
                ?>
</h1>
						
						<?php 
                // portfolio filters
                if ($page_template == 'template-portfolio.php' && $display_sortable == '1' && $inline_filters == '0') {
                    ?>
						<div id="<?php 
                    echo $filters_id;
                    ?>
">
							
							<a href="#" data-sortable-label="<?php 
                    echo !empty($options['portfolio-sortable-text']) ? $options['portfolio-sortable-text'] : 'Sort Portfolio';
                    ?>
" id="sort-portfolio"><span><?php 
                    echo !empty($options['portfolio-sortable-text']) ? $options['portfolio-sortable-text'] : __('Sort Portfolio', NECTAR_THEME_NAME);
                    ?>
</span> <i class="icon-angle-down"></i></a> 
							
							<ul>
							   <li><a href="#" data-filter="*"><?php 
                    echo __('All', NECTAR_THEME_NAME);
                    ?>
</a></li>
			               	   <?php 
                    wp_list_categories(array('title_li' => '', 'taxonomy' => 'project-type', 'show_option_none' => '', 'walker' => new Walker_Portfolio_Filter()));
                    ?>
							</ul>
						</div>
					<?php 
                }
                ?>
						
					</div>
				</div>



			</div>
	    	
	   <?php 
            }
        }
    }
Example #25
0
/**
 * Displays the link to the comments for the current post ID.
 *
 * @since 0.71
 *
 * @param string $zero      Optional. String to display when no comments. Default false.
 * @param string $one       Optional. String to display when only one comment is available.
 *                          Default false.
 * @param string $more      Optional. String to display when there are more than one comment.
 *                          Default false.
 * @param string $css_class Optional. CSS class to use for comments. Default empty.
 * @param string $none      Optional. String to display when comments have been turned off.
 *                          Default false.
 */
function comments_popup_link($zero = false, $one = false, $more = false, $css_class = '', $none = false)
{
    $id = get_the_ID();
    $title = get_the_title();
    $number = get_comments_number($id);
    if (false === $zero) {
        /* translators: %s: post title */
        $zero = sprintf(__('No Comments<span class="screen-reader-text"> on %s</span>'), $title);
    }
    if (false === $one) {
        /* translators: %s: post title */
        $one = sprintf(__('1 Comment<span class="screen-reader-text"> on %s</span>'), $title);
    }
    if (false === $more) {
        /* translators: 1: Number of comments 2: post title */
        $more = _n('%1$s Comment<span class="screen-reader-text"> on %2$s</span>', '%1$s Comments<span class="screen-reader-text"> on %2$s</span>', $number);
        $more = sprintf($more, number_format_i18n($number), $title);
    }
    if (false === $none) {
        /* translators: %s: post title */
        $none = sprintf(__('Comments Off<span class="screen-reader-text"> on %s</span>'), $title);
    }
    if (0 == $number && !comments_open() && !pings_open()) {
        echo '<span' . (!empty($css_class) ? ' class="' . esc_attr($css_class) . '"' : '') . '>' . $none . '</span>';
        return;
    }
    if (post_password_required()) {
        _e('Enter your password to view comments.');
        return;
    }
    echo '<a href="';
    if (0 == $number) {
        $respond_link = get_permalink() . '#respond';
        /**
         * Filter the respond link when a post has no comments.
         *
         * @since 4.4.0
         *
         * @param string $respond_link The default response link.
         * @param integer $id The post ID.
         */
        echo apply_filters('respond_link', $respond_link, $id);
    } else {
        comments_link();
    }
    echo '"';
    if (!empty($css_class)) {
        echo ' class="' . $css_class . '" ';
    }
    $attributes = '';
    /**
     * Filter the comments link attributes for display.
     *
     * @since 2.5.0
     *
     * @param string $attributes The comments link attributes. Default empty.
     */
    echo apply_filters('comments_popup_link_attributes', $attributes);
    echo '>';
    comments_number($zero, $one, $more);
    echo '</a>';
}
    function widget($args, $instance)
    {
        // outputs the content of the widget
        extract($args);
        if (isset($instance['title'])) {
            $title = apply_filters('widget_title', $instance['title']);
        } else {
            $title = '';
        }
        if (isset($instance['category'])) {
            $category = apply_filters('widget_category', $instance['category']);
        } else {
            $category = '';
        }
        if (isset($instance['numberposts'])) {
            $numberposts = apply_filters('widget_numberposts', $instance['numberposts']);
        } else {
            $numberposts = '';
        }
        echo $before_widget;
        ?>
  <section class="home-list-posts">
<?php 
        $args1 = array('cat' => $category, 'showposts' => $numberposts, 'post_type' => 'post', 'post_status' => 'publish');
        $minezine_my_query = new WP_Query($args1);
        ?>
 
                
<h2 class="entry-headline"><span class="entry-headline-text"><?php 
        echo $title;
        ?>
</span></h2>

<?php 
        if ($minezine_my_query->have_posts()) {
            $count = 0;
            while ($minezine_my_query->have_posts()) {
                $minezine_my_query->the_post();
                $count++;
                if ($count == 1) {
                    ?>
                  
      <article class="post-entry post-entry-list-first">
        <div class="post-content">
<?php 
                    if (has_post_thumbnail()) {
                        ?>
<a href="<?php 
                        echo get_permalink();
                        ?>
"><?php 
                        the_post_thumbnail();
                        ?>
</a><?php 
                    }
                    ?>
          <div class="post-entry-content">
            <h2 class="post-entry-headline"><a href="<?php 
                    echo get_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
            <p class="post-meta">
              <span class="post-info-date"><a href="<?php 
                    echo get_permalink();
                    ?>
"><?php 
                    echo get_the_date();
                    ?>
</a></span>
<?php 
                    if (comments_open()) {
                        ?>
              <span class="post-info-comments"><a href="<?php 
                        comments_link();
                        ?>
"><?php 
                        printf(_n('1 Comment', '%1$s Comments', get_comments_number(), 'minezine'), number_format_i18n(get_comments_number()), get_the_title());
                        ?>
</a></span>
<?php 
                    }
                    ?>
            </p>
<?php 
                    the_excerpt();
                    ?>
          </div>
        </div>
      </article>
      <div class="home-list-posts-wrapper">      
        <ul>
<?php 
                } else {
                    ?>
           
          <li><a href="<?php 
                    echo get_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></li>
<?php 
                }
            }
        }
        wp_reset_postdata();
        ?>
        </ul> 
      </div>
  </section>
<?php 
        echo $after_widget;
    }
    the_time(get_option('date_format'));
    ?>
</a> <span>/</span>
                                            <?php 
    the_category(', ');
    ?>
                                        </div>
                                        <div class="separator"></div>
                                        <p><?php 
    echo wp_trim_words(get_the_content(), 55, '...');
    ?>
</p>
                                        <div class="separator"></div>
                                        <div class="icons">
                                            <a href="<?php 
    echo comments_link();
    ?>
"><i class="icon-comment"></i> <span><?php 
    comments_number('0', '1', '%');
    ?>
</span></a>

                                            <a href="#" data-id="<?php 
    echo $post->ID;
    ?>
" class="text icn-like <?php 
    if ($liked == 1) {
        echo 'liked';
    }
    ?>
">
Example #28
0
function tin_post_meta($special = 0)
{
    $thelayout = the_layout();
    if (is_singular()) {
        ?>
	<div id="single-meta">
		<span class="single-meta-author"><i class="fa fa-user">&nbsp;</i><?php 
        the_author_posts_link();
        ?>
</span>
		<span class="single-meta-time"><i class="fa fa-calendar">&nbsp;</i><?php 
        echo timeago(get_gmt_from_date(get_the_time('Y-m-d G:i:s')));
        ?>
</span>
		<?php 
        if (is_single()) {
            ?>
<span class="single-meta-category"><i class="fa fa-folder-open">&nbsp;</i><?php 
            the_category(' ', '');
            ?>
</span><?php 
        }
        ?>
		<?php 
        if (current_user_can('level_7')) {
            ?>
<span class="single-meta-edit"><i class="fa fa-edit">&nbsp;</i><?php 
            edit_post_link(__(' 编辑 ', 'tinection'));
            ?>
</span><?php 
        }
        ?>
		<span class="single-meta-comments"><?php 
        if (comments_open()) {
            ?>
|&nbsp;&nbsp;<i class="fa fa-comments"></i>&nbsp;<a href="#" class="commentbtn"><?php 
            comments_number(__('抢沙发', 'tinection'), __('1 条评论', 'tinection'), __('% 条评论', 'tinection'));
            ?>
</a><?php 
        } else {
            ?>
|&nbsp;<i class="fa fa-comments"></i><?php 
            _e(' 评论关闭', 'tinection');
        }
        ?>
</span>
		<span class="single-meta-views"><i class="fa fa-fire"></i>&nbsp;<?php 
        echo get_tin_traffic('single', get_the_ID());
        ?>
&nbsp;</span>
	</div>
	<?php 
    } elseif (is_search() || is_home() && $thelayout == 'blog' || is_category() && $special == 0 || is_tag() || is_date()) {
        ?>
	<div class="meta">
		<?php 
        if (!is_category()) {
            ?>
<span class="postlist-meta-cat"><i class="fa fa-bookmark"></i><?php 
            the_category(' ', false);
            ?>
</span><?php 
        }
        ?>
		<span class="postlist-meta-time"><i class="fa fa-calendar"></i><?php 
        echo timeago(get_gmt_from_date(get_the_time('Y-m-d G:i:s')));
        ?>
</span>
		<span class="postlist-meta-views"><i class="fa fa-fire"></i><?php 
        echo '浏览: ' . get_tin_traffic('single', get_the_ID());
        ?>
</span>
		<span class="postlist-meta-comments"><?php 
        if (comments_open()) {
            ?>
<i class="fa fa-comments"></i><a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number(__('<span>评论: </span>0', 'tinection'), __('<span>评论: </span>1', 'tinection'), __('<span>评论: </span>%', 'tinection'));
            ?>
</a><?php 
        }
        ?>
</span>
	</div>
	<?php 
    } elseif (is_home() || is_category() && $special == 1) {
        ?>
	<div class="postlist-meta">
		<div class="postlist-meta-time"><i class="fa fa-calendar"></i>&nbsp;<?php 
        echo date('Y-m-j', get_the_time('U'));
        ?>
</div>
		<div class="postlist-meta-views" style="float:right;"><i class="fa fa-fire"></i>&nbsp;<?php 
        echo get_tin_traffic('single', get_the_ID());
        ?>
</div>
		<?php 
        get_template_part('includes/like_collect_meta');
        ?>
	</div>
	<?php 
    } else {
        ?>
	<div id="single-meta">
		<span class="single-meta-author"><i class="fa fa-user">&nbsp;</i><?php 
        the_author_posts_link();
        ?>
</span>
		<span class="single-meta-edit"><?php 
        edit_post_link(__(' 编辑 ', 'tinection'));
        ?>
</span>
		<span class="single-meta-time"><i class="fa fa-calendar">&nbsp;</i><?php 
        echo timeago(get_gmt_from_date(get_the_time('Y-m-d G:i:s')));
        ?>
</span>
		<span class="single-meta-comments"><?php 
        if (comments_open()) {
            ?>
|&nbsp;&nbsp;<i class="fa fa-comments"></i>&nbsp;<a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number(__('0 条评论', 'tinection'), __('1 条评论', 'tinection'), __('% 条评论', 'tinection'));
            ?>
</a><?php 
        } else {
            ?>
|&nbsp;<i class="fa fa-comments"></i><?php 
            _e(' 评论关闭', 'tinection');
        }
        ?>
</span>
		<span class="single-meta-views"><i class="fa fa-fire"></i>&nbsp;<?php 
        echo get_tin_traffic('single', get_the_ID());
        ?>
&nbsp;</span>
	</div>
	<?php 
    }
}
Example #29
0
    while (have_posts()) {
        the_post();
        ?>

					<div class="single-post" id="post-<?php 
        the_ID();
        ?>
" <?php 
        post_class();
        ?>
>  
<?php 
        if (comments_open()) {
            ?>
<div class="comm-ind"><a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number('0', '1', '%');
            ?>
</a>
</div>
<?php 
        }
        ?>
	<h2><a href="<?php 
        the_permalink();
        ?>
" rel="bookmark" title="Permanent Link to <?php 
        the_title_attribute();
        ?>
Example #30
0
<?php
/**
 * Search page 
 *
 * @package     charity
 * @version     v.1.0
 */
?><article <?php post_class("blog search-blog"); ?>>
    <div class="row">
        <div class="col-xs-12 col-sm-10  caption">
            <h2 class="h1"><a href="<?php the_permalink(); ?> "><?php the_title() ?></a></h2>
            <?php if ( 'post' == get_post_type() ) : ?>
            <ul class="post-in">
                <li>
                    <?php  
                        esc_html_e("Posted In  :", "charity");
                        the_category(", ");
                    ?>
                </li>
                <li>
                    <a href="<?php comments_link(); ?>"><?php comments_number( '0 : comment', '1 : comment', '% : comments' ); ?></a>
                </li>
            </ul>
            <?php endif; ?>
           <?php the_excerpt(); ?>
        </div>
    </div>
</article>
<?php