Пример #1
0
/**
 * Multi News replace breadcrumb.
 *
 * @since 1.0.0
 * @package GeoDirectory
 */
function gd_mn_replace_breadcrums()
{
    if (mom_option('breadcrumb') != 0) {
        ?>
        <?php 
        if (mom_option('cats_bread')) {
            $cclass = '';
            if (mom_option('cat_slider') == false) {
                $cclass = 'post-crumbs ';
            }
            ?>
            <div class="<?php 
            echo $cclass;
            ?>
entry-crumbs" xmlns:v="http://rdf.data-vocabulary.org/#">

                <?php 
            mom_breadcrumb();
            ?>


            </div>
        <?php 
        }
        ?>
    <?php 
    }
}
Пример #2
0
function mom_pagination($pages = '', $range = 4)
{
    global $wp_query;
    if (get_query_var('paged')) {
        $paged = get_query_var('paged');
    } elseif (get_query_var('page')) {
        $paged = get_query_var('page');
    } else {
        $paged = 1;
    }
    if (mom_option('pagi_type') == false) {
        $showitems = $range * 2 + 1;
        if (empty($paged)) {
            $paged = 1;
        }
        if ($pages == '') {
            global $wp_query;
            $pages = $wp_query->max_num_pages;
            if (!$pages) {
                $pages = 1;
            }
        }
        if (1 != $pages) {
            echo "<div class='pagination'>";
            if ($paged > 2 && $paged > $range + 1 && $showitems < $pages) {
                echo "<a href='" . get_pagenum_link(1) . "'>&laquo;</a>";
            }
            if ($paged > 1 && $showitems < $pages) {
                echo "<a href='" . get_pagenum_link($paged - 1) . "'>&lsaquo;</a>";
            }
            for ($i = 1; $i <= $pages; $i++) {
                if (1 != $pages && (!($i >= $paged + $range + 1 || $i <= $paged - $range - 1) || $pages <= $showitems)) {
                    echo $paged == $i ? "<span class='current'>" . $i . "</span>" : "<a href='" . get_pagenum_link($i) . "' class='inactive' >" . $i . "</a>";
                }
            }
            if ($paged < $pages && $showitems < $pages) {
                echo "<a href='" . get_pagenum_link($paged + 1) . "'>&rsaquo;</a>";
            }
            if ($paged < $pages - 1 && $paged + $range - 1 < $pages && $showitems < $pages) {
                echo "<a href='" . get_pagenum_link($pages) . "'>&raquo;</a>";
            }
            echo "</div>\n";
        }
    } else {
        $big = 999999999;
        // need an unlikely integer
        echo "<div class='pagination'>";
        echo paginate_links(array('base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), 'format' => '?paged=%#%', 'current' => max(1, $paged), 'total' => $wp_query->max_num_pages));
        echo "</div>\n";
    }
}
Пример #3
0
function mom_search_in_wp_ticker($items, $args)
{
    if ($args->theme_location == 'breaking') {
        ob_start();
        ?>
  <li class="top-search breaking-search menu-item-iconsOnly"><a href="#"><i class="icon_only fa-icon-search"></i></a>
<div class="search-dropdown">
  <form class="mom-search-form" method="get" action="<?php 
        echo home_url();
        ?>
/">
      <input type="text" id="tb-search" class="sf" name="s" placeholder="<?php 
        _e('Enter keywords and press enter', 'framework');
        ?>
" required="" autocomplete="off">
    <?php 
        if (mom_option('ajax_search_disable')) {
            ?>
<span class="sf-loading"><img src="<?php 
            echo MOM_IMG;
            ?>
/ajax-search-nav.png" alt="search" width="16" height="16"></span><?php 
        }
        ?>
    <?php 
        if (defined('ICL_LANGUAGE_CODE')) {
            ?>
<input type="hidden" name="lang" value="<?php 
            echo ICL_LANGUAGE_CODE;
            ?>
"/><?php 
        }
        ?>
  </form>
  <?php 
        if (mom_option('ajax_search_disable')) {
            ?>
  <div class="ajax-search-results"></div>
  <?php 
        }
        ?>
</div>
</li>

<?php 
        $output = ob_get_contents();
        ob_end_clean();
        $items .= $output;
    }
    return $items;
}
Пример #4
0
function mom_layout_sidebar($atts, $content = null)
{
    extract(shortcode_atts(array('sidebar' => ''), $atts));
    $swstyle = mom_option('swstyle');
    if ($swstyle == 'style2') {
        $swclass = ' sws2';
    } else {
        $swclass = '';
    }
    $output = '</div><aside class="sidebar' . $swclass . '" itemtype="http://schema.org/WPSideBar" itemscope="itemscope" role="complementary">';
    ob_start();
    if (!function_exists('dynamic_sidebar') || !dynamic_sidebar($sidebar)) {
    }
    $output .= ob_get_contents();
    ob_end_clean();
    $output .= "</aside>";
    return $output;
}
Пример #5
0
function mom_youtube_duration($id)
{
    delete_option('mom_yotube3_video_duration_' . $id);
    $key = mom_option('youtube_api_key');
    if ($key != '') {
        $duration = get_transient('mom_yotube3_video_duration_' . $id);
        $duration = 0;
        $data = wp_remote_get('https://www.googleapis.com/youtube/v3/videos?id=' . $id . '&part=contentDetails&key=' . $key);
        if (!is_wp_error($data)) {
            $json = json_decode($data['body'], true);
            $duration = isset($json['items'][0]['contentDetails']['duration']) ? $json['items'][0]['contentDetails']['duration'] : '';
            $duration = mom_youtube_covtime($duration);
            set_transient('mom_yotube3_video_duration_' . $id, $duration, 60 * 60 * 24);
            return $duration;
        } else {
            return 'error';
        }
    } else {
        return false;
    }
}
Пример #6
0
    ?>
                                					        <?php 
    if (mom_option('post_bottom_ad') != '' && $disable_ads == 0) {
        echo do_shortcode('[ad id="' . mom_option('post_bottom_ad') . '"]');
        echo do_shortcode('[gap height="20"]');
    }
    ?>

                            </div>

                    <?php 
    if ($layout != 'fullwidth') {
        ?>
                        </div><!--Main Content-->
                    	<?php 
        $swstyle = mom_option('swstyle');
        if ($swstyle == 'style2') {
            $swclass = ' sws2';
        } else {
            $swclass = '';
        }
        if ($site_width != 'wide' || strpos($layout, 'both') !== false) {
            if ($cat_ssidebar != '') {
                ?>
	                    <aside class="secondary-sidebar<?php 
                echo $swclass;
                ?>
" role="complementary" itemscope="itemscope" itemtype="http://schema.org/WPSideBar"><!--secondary sidebar-->
	                    	<?php 
                dynamic_sidebar($cat_ssidebar);
                ?>
Пример #7
0
                } elseif (is_account_page()) {
                    $woo_page_id = get_option('woocommerce_myaccount_page_id');
                } else {
                    $woo_page_id = get_option('woocommerce_shop_page_id');
                }
                if (mom_option('woo_lsidebar') != '') {
                    $archivesidebar = mom_option('woo_lsidebar');
                } else {
                    $archivesidebar = get_post_meta($woo_page_id, 'mom_left_sidebar', TRUE);
                }
            }
            if (function_exists('is_bbpress') && is_bbpress()) {
                $archivesidebar = mom_option('bbpress_left_sidebar');
            }
            if (function_exists('is_buddypress') && is_buddypress()) {
                $archivesidebar = mom_option('buddypress_left_sidebar');
            }
            if (!empty($archivesidebar)) {
                dynamic_sidebar($archivesidebar);
            } else {
                dynamic_sidebar('Secondary sidebar');
            }
        } else {
            dynamic_sidebar('Secondary sidebar');
        }
        ?>
</aside><!--secondary sidebar-->
<?php 
    }
}
// if hide in the mobiles
Пример #8
0
Template Name: People List
*/
get_header();
global $post;
$pagebreadcrumb = get_post_meta($post->ID, 'mom_hide_breadcrumb', true);
$icon = get_post_meta($post->ID, 'mom_page_icon', true);
$layout = get_post_meta(get_the_ID(), 'mom_page_layout', true);
$PS = get_post_meta(get_the_ID(), 'mom_page_share', true);
$PC = get_post_meta(get_the_ID(), 'mom_page_comments', true);
?>


<div class="main-container"><!--container-->                  
     
    <?php 
if (mom_option('breadcrumb') != 0) {
    ?>
    <?php 
    if ($pagebreadcrumb != true) {
        ?>
    
    <div class="post-crumbs archive-page entry-crumbs" xmlns:v="http://rdf.data-vocabulary.org/#">
                    	<?php 
        if ($icon != '') {
            if (0 === strpos($icon, 'http')) {
                echo '<div class="crumb-icon"><i class="img_icon" style="background-image: url(' . $icon . ')"></i></div>';
            } else {
                echo '<div class="crumb-icon"><i class="' . $icon . '"></i></div>';
            }
        } else {
            ?>
Пример #9
0
<?php

global $personPosts;
$dateformat = mom_option('date_format');
?>

<?php 
?>

        <ul class="mom-related-posts clearfix">
                <?php 
if (1 == 1) {
    //				$query = new WP_Query( array( 'post_type' => 'appearance', 'post__in' => array( 4,6,7,8,9,10 ) ) );
    $query = new WP_Query(array('post_type' => 'appearance', 'post__in' => $personPosts));
    update_post_thumbnail_cache($query);
    if ($query->have_posts()) {
        while ($query->have_posts()) {
            $query->the_post();
            ?>
                <li 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('related-thumb');
                ?>
                        </a></figure>
Пример #10
0
function mom_google_fonts()
{
    $cutomfont = mom_option('font-name');
    $safe_fonts = array('' => 'Default', 'arial' => 'Arial', 'georgia' => 'Georgia', 'arial' => 'Arial', 'verdana' => 'Verdana, Geneva', 'trebuchet' => 'Trebuchet', 'times' => 'Times New Roman', 'tahoma' => 'Tahoma, Geneva', 'palatino' => 'Palatino', 'helvetica' => 'Helvetica', 'Archivo Narrow' => 'Archivo Narrow', $cutomfont => $cutomfont);
    return $safe_fonts;
}
Пример #11
0
						'<span class="enotype-icon-uniE6D8"></span>'
					],
		});
	        });
			</script>
			
		</div>
		
<?php 
} else {
    $mom_post_layout = get_post_meta($post->ID, 'mom_post_layout', true);
    if ($mom_post_layout == '') {
        $mom_post_layout = mom_option('post_layout');
    }
    if ($mom_post_layout == 'layout5') {
        if (mom_option('post_feaimage') == 1) {
            if (mom_post_image() != false) {
                ?>
								<figure class="post-thumbnail" itemprop="associatedMedia" itemscope="" itemtype="http://schema.org/ImageObject">
								<?php 
                echo '<img class="post_layout_5_img" src="' . mom_post_image('full') . '" alt="' . get_the_title() . '">';
                ?>
</figure><?php 
                if ($PCT != '') {
                    ?>
<div class="photo-credit img-pct"><i class="momizat-icon-camera"></i><?php 
                    _e('Photo Credit To ', 'framework');
                    echo $PCT;
                    ?>
</div><?php 
                }
Пример #12
0
        <meta itemprop="name" content="<?php 
    bloginfo('name');
    ?>
">
    </div>
<?php 
}
?>
           <?php 
if ($logo_left_banner) {
    echo '<div class="logo_left_banner">' . do_shortcode('[ad id="' . $logo_left_banner . '"]') . '</div>';
}
if ($logo_right_banner) {
    echo '<div class="logo_right_banner">' . do_shortcode('[ad id="' . $logo_right_banner . '"]') . '</div>';
}
?>
     
<?php 
if (mom_option('h_banner_type') == 'ads') {
    ?>
    <div class="header-banner">
		<?php 
    echo do_shortcode('[ad id="' . $header_banner . '"]');
    ?>
    </div>
<?php 
} else {
    if (mom_option('header_custom_content') != '' && mom_option('h_banner_type') == 'custom') {
        echo '<div class="header-right header-right_custom-content">' . do_shortcode(mom_option('header_custom_content')) . '</div>';
    }
}
Пример #13
0
function mom_posts_share($id, $url, $style = null)
{
    $url = esc_url($url);
    $desc = esc_attr(wp_html_excerpt(strip_shortcodes(get_the_content()), 160));
    $img = esc_url(mom_post_image('large'));
    $title = esc_attr(get_the_title());
    $window_title = __('Share This', 'framework');
    $window_width = 600;
    $window_height = 455;
    ?>
<script>
    jQuery(document).ready(function($) {
        var url = '<?php 
    echo $url;
    ?>
'; 
        <?php 
    if (mom_option('sharee_tw') != 0) {
        // twitter
        /* jQuery.getJSON(
                 'ht'+'tp://urls.api.twitter.com/1/urls/count.json?url='+url+'&callback=?',
                 function (data) {
           //console.log(data.count);
           $('.share-twitter .count').text(data.count);
                     }
             ); */
        //delete_transient('mom_share_twitter_'.$id);
        $twitter = get_transient('mom_share_twitter_' . $id);
        if ($twitter == null) {
            $twitter_url = wp_remote_get('http://urls.api.twitter.com/1/urls/count.json?url=' . $url);
            if (!is_wp_error($twitter_url)) {
                $twitter = json_decode($twitter_url['body'], true);
                $twitter = $twitter['count'];
                set_transient('mom_share_twitter_' . $id, $twitter, 1800);
            } else {
                $twitter = 0;
            }
        }
    }
    ?>
		<?php 
    if (mom_option('sharee_fb') != 0) {
        //facebook
        delete_transient('mom_share_facebook_' . $id);
        $facebook = get_transient('mom_share_facebook_' . $id);
        if ($facebook == null) {
            $facebook_url = wp_remote_get('http://api.facebook.com/method/links.getStats?urls=' . $url . '&format=json');
            if (!is_wp_error($facebook_url)) {
                $facebook = json_decode($facebook_url['body'], true);
                $share_count = isset($facebook[0]['total_count']) ? $facebook[0]['total_count'] : 0;
                //$like_count = isset($facebook[0]['like_count']) ? $facebook[0]['like_count'] : 0;
                $facebook = $share_count;
                set_transient('mom_share_facebook_' . $id, $facebook, 2000);
            } else {
                $facebook = 0;
            }
        }
        // facebook
        /* jQuery.getJSON(
                   'ht'+'tp://api.facebook.com/method/links.getStats?urls='+url+'&format=json',
                   function (data) {
                       //console.log(data[0].like_count);
        			if( data[0] !== undefined ){
                        $('.share-facebook .count').text(data[0].like_count);
                       // console.log(data);
                       }
                   }
               ); */
    }
    ?>
		<?php 
    if (mom_option('sharee_lin') != 0) {
        ?>
        // linkedin
        jQuery.getJSON(
	    'http://www.linkedin.com/countserv/count/share?format=jsonp&url='+url+'&callback=?',
            function (data) {

                //console.log(data.count);
                $('.share-linkedin .count').text(data.count);
            }
        );
        <?php 
    }
    ?>
		<?php 
    if (mom_option('sharee_pin') != 0) {
        ?>
        // Pintrest
        jQuery.getJSON(
	    'http://api.pinterest.com/v1/urls/count.json?url='+url+'&callback=?',
            function (data) {
                //console.log(data.count);
                $('.share-pin .count').text(data.count);
            }
        );
        <?php 
    }
    ?>
	
    });
    

</script>
<?php 
    $plusone = 0;
    $plusone = mom_getGoogleCount($url);
    ?>
	
		<div class="mom-share-post">
		        <h4><?php 
    _e('share', 'framework');
    ?>
</h4>
		        <div class="mom-share-buttons">
		            	<?php 
    if (mom_option('sharee_fb') != 0) {
        ?>
		                <a href="#" onclick="window.open('http://www.facebook.com/sharer/sharer.php?m2w&s=100&p&#91;url&#93;=<?php 
        echo $url;
        ?>
', '<?php 
        echo $window_title;
        ?>
', 'menubar=no,toolbar=no,resizable=no,scrollbars=no, width=<?php 
        echo $window_width;
        ?>
,height=<?php 
        echo $window_height;
        ?>
');" class="share-facebook"><i class="enotype-icon-facebook"></i><span class="count"><?php 
        echo $facebook;
        ?>
</span></a>
		                <?php 
    }
    ?>
		                <?php 
    if (mom_option('sharee_tw') != 0) {
        ?>
		                <a href="#" onclick="window.open('http://twitter.com/share?text=<?php 
        echo $title;
        ?>
&url=<?php 
        echo $url;
        ?>
', '<?php 
        _e('Post this On twitter', 'theme');
        ?>
', 'menubar=no,toolbar=no,resizable=no,scrollbars=no,width=<?php 
        echo $window_width;
        ?>
,height=<?php 
        echo $window_height;
        ?>
');" class="share-twitter"><i class="momizat-icon-twitter"></i><span class="count"><?php 
        echo $twitter;
        ?>
</span></a>
		                <?php 
    }
    ?>
		                <?php 
    if (mom_option('sharee_go') != 0) {
        ?>
		                <a href="#" onclick="window.open('https://plus.google.com/share?url=<?php 
        echo $url;
        ?>
', 'Share', 'width=<?php 
        echo $window_width;
        ?>
,height=<?php 
        echo $window_height;
        ?>
');" class="share-google"><i class="momizat-icon-google-plus"></i><span class="count"><?php 
        echo $plusone;
        ?>
</span></a>
		                <?php 
    }
    ?>
		                <?php 
    if (mom_option('sharee_lin') != 0) {
        ?>
		                <a href="#" onclick="window.open('http://www.linkedin.com/shareArticle?mini=true&url=<?php 
        echo $url;
        ?>
&title=<?php 
        print urlencode(the_title());
        ?>
&source=<?php 
        echo home_url();
        ?>
', 'Share This', 'width=<?php 
        echo $window_width;
        ?>
,height=<?php 
        echo $window_height;
        ?>
');" class="share-linkedin"><i class="fa-icon-linkedin"></i><span class="count">0</span></a>
		                <?php 
    }
    ?>
		                <?php 
    if (mom_option('sharee_pin') != 0) {
        ?>
		                <a href="#" onclick="window.open('http://pinterest.com/pin/create/bookmarklet/?media=<?php 
        echo mom_post_image('medium');
        ?>
&amp;url=<?php 
        echo $url;
        ?>
&amp;is_video=false&amp;description=<?php 
        echo $title;
        ?>
', 'Share this', 'width=<?php 
        echo $window_width;
        ?>
,height=<?php 
        echo $window_height;
        ?>
');" class="share-pin"><i class="enotype-icon-pinterest"></i><span class="count">0</span></a>
		                <?php 
    }
    ?>
		                <?php 
    if (mom_option('sharee_vk') != 0) {
        ?>
		                <a href="#" onclick="window.open('http://vkontakte.ru/share.php?url=<?php 
        echo $url;
        ?>
&title=<?php 
        print urlencode(the_title());
        ?>
&image=<?php 
        echo $img;
        ?>
&description=<?php 
        echo $desc;
        ?>
', 'Share this', 'width=<?php 
        echo $window_width;
        ?>
,height=<?php 
        echo $window_height;
        ?>
');" class="share-vk"><i class="fa-icon-vk"></i></a>
		                <?php 
    }
    ?>
		                <?php 
    if (mom_option('sharee_xing') != 0) {
        ?>
		                <a href="#" onclick="window.open('https://www.xing.com/social_plugins/share?url=<?php 
        echo $url;
        ?>
&wtmc=XING;&sc_p=xing-share', 'Share this', 'width=<?php 
        echo $window_width;
        ?>
,height=<?php 
        echo $window_height;
        ?>
');" class="share-vk"><i class="fa-icon-xing"></i></a>
		                <?php 
    }
    ?>
		                <?php 
    if (mom_option('sharee_mail') != 0) {
        ?>
		                <a href="mailto:?subject=<?php 
        print urlencode(the_title());
        ?>
&body=<?php 
        print urlencode(wp_html_excerpt(get_the_content(), 160));
        __('Read More', 'framework');
        ?>
 : <?php 
        echo $url;
        ?>
" class="share-email"><i class="dashicons dashicons-email-alt"></i></a>
		                <?php 
    }
    ?>
		                <?php 
    if (mom_option('sharee_print') != 0) {
        ?>
		                <a href="javascript:window.print()" rel="nofollow" class="share-email"><i class="brankic-icon-printer"></i></a>
		                <?php 
    }
    ?>
	                
		        </div>
		        <!--
<a href="#" class="sh_arrow"><span><?php 
    _e('More', 'framework');
    ?>
</span><br>
		            <i class="icon-double-angle-down"></i>
		        </a>
-->
		</div>
<?php 
}
Пример #14
0
    comments_number(__('Leave a comment', 'framework'), __('(1) Comment', 'framework'), __('(%) Comments', 'framework'));
    ?>
</a></div>
    <?php 
}
?>
    <?php 
if (mom_option('post_head_views') != 0) {
    ?>
    <div class="post-views"><?php 
    echo getPostViews(get_the_ID());
    ?>
</div>
    <?php 
}
?>
    <?php 
//edit_post_link( __( 'Edit', 'framework' ), '<div class="edit-link">', '</div>' );
?>
</div>
<div class="top-share-icons">
<?php 
if (mom_option('share_position') == 'top' || mom_option('share_position') == 'both') {
    if (mom_option('post_sharee')) {
        if ($DPS != 1) {
            mom_posts_share(get_the_ID(), get_permalink());
        }
    }
}
?>
</div>
Пример #15
0
<?php

if (mom_option('top_banner') == 1) {
    if (mom_display_logic('top_banner_display_logic') == true) {
        $auto_close = mom_option('top_banner_close_timeout');
        ?>
<div class="top_banner" data-timeout="<?php 
        echo $auto_close;
        ?>
">
 <div class="inner">
   <?php 
        if (mom_option('top_banner_close') == 1) {
            $save_state = 'tb_save_close';
            if (mom_option('top_banner_close_save') == 1) {
                $save_state = 'tb_save_close';
            }
            echo '<a class="tob_banner_close ' . $save_state . '" href="#" data-exp="7"><i class="fa-icon-remove"></i></a>';
        }
        if (mom_option('top_banner_content') == 1) {
            echo do_shortcode('[ad id="' . mom_option('top_banner_ad') . '"]');
        } else {
            echo do_shortcode(mom_option('top_banner_custom'));
        }
        ?>
 </div>
</div>
 <?php 
    }
}
Пример #16
0
if ($sticky_logo) {
    ?>
	<a href="<?php 
    echo esc_url(home_url());
    ?>
" class="sticky_logo"><img src="<?php 
    echo $sticky_logo;
    ?>
" alt="<?php 
    bloginfo('name');
    ?>
" width="<?php 
    echo mom_option('sticky_navigation_logo', 'width');
    ?>
" height="<?php 
    echo mom_option('sticky_navigation_logo', 'height');
    ?>
"></a>
    <?php 
}
?>
		<?php 
if (has_nav_menu('main')) {
    if ($menu != '') {
        wp_nav_menu(array('menu_class' => 'main-menu main-default-menu', 'container' => 'ul', 'menu' => $menu, 'walker' => new mom_custom_Walker()));
    } else {
        $main_menu_query = get_transient('main_menu_query' . get_queried_object_id() . $lang . $user);
        if (function_exists('is_buddypress')) {
            $main_menu_query = false;
        }
        if ($main_menu_query === false) {
Пример #17
0
function mom_feature_slider($atts, $content = null)
{
    global $unique_posts;
    global $do_unique_posts;
    extract(shortcode_atts(array('id' => '', 'type' => 'def', 'display' => 'latest', 'cats' => '', 'tag' => '', 'specific' => '', 'orderby' => '', 'number_of_posts' => '', 'animation' => '', 'animationin' => '', 'animationout' => '', 'autoplay' => '', 'timeout' => '4000', 'cap' => 'yes', 'exc' => '', 'class' => '', 'num_bullets' => '', 'bullets_event' => ''), $atts));
    if ($id == '') {
        static $id = 75;
        $id++;
    }
    $specific = explode(',', $specific);
    if ($type == 'cat') {
        wp_enqueue_script('cycle');
        wp_enqueue_script('nicescroll');
    }
    if ($cats == 'Select a Category') {
        $cats = '';
    }
    if ($tag == 'Select a Tag') {
        $tag = '';
    }
    $output = get_transient('mom_feature_sliders' . $id . $type . $display . $cats . $tag . $class . $orderby);
    if ($orderby == 'rand') {
        $output = false;
    }
    if ($output == false) {
        ob_start();
        if ($num_bullets == 'yes') {
            $class .= ' numbers_bullets';
        }
        if (is_rtl()) {
            $rtl = 'true';
        } else {
            $rtl = 'false';
        }
        if ($animation == 'fade') {
            $animationout = 'fadeOut';
            $animationin = '';
        } elseif ($animation == 'slide') {
            $animationout = '';
            $animationin = '';
        } elseif ($animation == 'flip') {
            $animationout = 'slideOutDown';
            $animationin = 'flipInX';
        }
        if ($autoplay == 'no') {
            $autoplay = 'false';
        } else {
            $autoplay = 'true';
        }
        $post_meta_hp = mom_option('post_meta_hp');
        if ($post_meta_hp == 1) {
            $post_head = mom_option('post_head');
            $post_head_date = mom_option('post_head_date');
        } else {
            $post_head = 1;
            $post_head_date = 1;
        }
        ?>
							<?php 
        if ($type == 'slider2') {
            ?>
 <!-- Full width Slider 2 -->
									
							<section class="section <?php 
            echo $class;
            ?>
 feature_slider_<?php 
            echo $id;
            ?>
"><!--def slider-->
				                    	<div class="slider2 clearfix"> <!-- slider2 wrap -->
					                    	<?php 
            if ($display == 'cat') {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $cats, 'posts_per_page' => 2, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tag') {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'tag' => $tag, 'posts_per_page' => 2, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'specific') {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'post__in' => $specific, 'posts_per_page' => 2, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 2, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            }
            if ($query->have_posts()) {
                while ($query->have_posts()) {
                    $query->the_post();
                    if ($unique_posts) {
                        $do_unique_posts[] = get_the_ID();
                    }
                    ?>
				                            <?php 
                    if (mom_post_image() != false) {
                        ?>
					                    	<div class="def-slider-item big-slider2" itemscope="" itemtype="http://schema.org/Article">
					                            <a itemprop="url" href="<?php 
                        the_permalink();
                        ?>
">
					                            	<?php 
                        mom_post_image_full('catslider-thumb');
                        ?>
					                            </a>
					                            <?php 
                        if ($cap != 'no') {
                            ?>
					                            <div class="def-slider-cap">
					                                <div class="def-slider-title">
					                                    <h2 itemprop="name"><a itemprop="url" href="<?php 
                            the_permalink();
                            ?>
"><?php 
                            the_title();
                            ?>
</a></h2>
					                                </div>
		                                                <?php 
                            if ($exc != false) {
                                ?>
					                                <p class="def-slider-desc">
					                                    <?php 
                                global $post;
                                $excerpt = $post->post_excerpt;
                                if ($excerpt == '') {
                                    $excerpt = get_the_content('');
                                }
                                echo wp_html_excerpt(strip_shortcodes($excerpt), $exc);
                                ?>
 ...
					                                </p>
					                                <?php 
                            }
                            ?>
					                            </div>
					                            <?php 
                        }
                        ?>
					                        </div>
					                        <?php 
                    }
                    ?>
					                        <?php 
                }
            } else {
            }
            wp_reset_postdata();
            ?>
				                            
				                            <?php 
            if ($display == 'cat') {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $cats, 'posts_per_page' => 3, 'offset' => 2, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tag') {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'tag' => $tag, 'posts_per_page' => 3, 'offset' => 2, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'specific') {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'post__in' => $specific, 'posts_per_page' => 3, 'offset' => 2, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 3, 'offset' => 2, 'orderby' => $orderby, '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();
                    }
                    ?>
				                            <?php 
                    if (mom_post_image() != false) {
                        ?>
					                        <div class="def-slider-item small-slider2" itemscope="" itemtype="http://schema.org/Article">
					                            <a itemprop="url" href="<?php 
                        the_permalink();
                        ?>
"><?php 
                        mom_post_image_full('catslider-thumb');
                        ?>
</a>
					                            <?php 
                        if ($cap != 'no') {
                            ?>
					                            <div class="def-slider-cap">
					                                <div class="def-slider-title">
					                                    <h2 itemprop="name"><a itemprop="url" href="<?php 
                            the_permalink();
                            ?>
"><?php 
                            the_title();
                            ?>
</a></h2>
					                                </div>
		                                                <?php 
                            if ($exc != false) {
                                ?>
					                                <p class="def-slider-desc">
					                                    <?php 
                                global $post;
                                $excerpt = $post->post_excerpt;
                                if ($excerpt == '') {
                                    $excerpt = get_the_content('');
                                }
                                echo wp_html_excerpt(strip_shortcodes($excerpt), $exc);
                                ?>
 ...
					                                </p>
					                                <?php 
                            }
                            ?>
					                            </div>
					                            <?php 
                        }
                        ?>
					                        </div>
					                        <?php 
                    }
                    ?>
					                        <?php 
                }
            } else {
            }
            wp_reset_postdata();
            ?>
				                    	</div><!-- slider2 wrap -->
				                    </section>
				                    
				            <?php 
        } elseif ($type == 'cat') {
            ?>
			            		
						
								<section class="section clearfix <?php 
            echo $class;
            ?>
 feature_slider_<?php 
            echo $id;
            ?>
 feature-cat-slider-wrap">
								<div class="fc_nav">
									<a class="fc_prev" href="#"><span class="enotype-icon-arrow-left7"></span></a>
									<a class="fc_next" href="#"><span class="enotype-icon-uniE6D8"></span></a>
								</div>
								    <div class="cat-slider feature-cat-slider">        
												<div class="cat-slider-wrap" data-cat_timeout="<?php 
            echo $timeout;
            ?>
">
										            <?php 
            $parent_posts = '';
            if ($display == 'cat') {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $cats, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tag') {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'specific') {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'post__in' => $specific, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, '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();
                    }
                    $parent_posts[] = get_the_ID();
                    ?>
								                    <?php 
                    if (mom_post_image() != false) {
                        ?>
										            <div class="cat-slider-item" itemscope="" itemtype="http://schema.org/Article">
														<?php 
                        $layout = mom_option('main_layout');
                        $site_width = mom_option('site_width');
                        $thumb_size = 'catslider1-thumb';
                        if (strpos($layout, 'both') === false) {
                            $thumb_size = 'catslider-thumb';
                            if ($site_width == 'wide') {
                                $thumb_size = 'catslider1-thumb';
                            }
                        }
                        if ($layout == 'fullwidth' && strpos(mom_option('main_layout'), 'both') !== false) {
                            $thumb_size = 'catslider1-thumb';
                        }
                        ?>
									                	<div class="feature-cs-cap">
									                		<?php 
                        $category = get_the_category();
                        if ($category) {
                            $cat_data = get_option("category_" . $category[0]->term_id);
                            $cat_color = isset($cat_data['color']) ? $cat_data['color'] : '';
                            echo '<div class="cat-label" style="background:' . $cat_color . ';"><a href="' . get_category_link($category[0]->term_id) . '" title="' . sprintf(__("View all posts in %s", 'framework'), $category[0]->name) . '" ' . '>' . $category[0]->name . '</a></div>';
                        }
                        ?>
									                		<h2 itemprop="name"><a href="<?php 
                        the_permalink();
                        ?>
" itemprop="url"><?php 
                        the_title();
                        ?>
</a></h2>
									                		<?php 
                        if ($exc != '') {
                            ?>
									                		<p class="feature-cs-desc">
							                                    <?php 
                            global $post;
                            $excerpt = $post->post_excerpt;
                            if ($excerpt == '') {
                                $excerpt = get_the_content('');
                            }
                            echo wp_html_excerpt(strip_shortcodes($excerpt), $exc);
                            ?>
 ...
							                                </p>
							                                <?php 
                        }
                        ?>
									                	</div>
										                <a href="<?php 
                        the_permalink();
                        ?>
">
									                	<?php 
                        echo mom_post_image_full($thumb_size);
                        ?>
										                </a>
										                	
										            </div>
										            <?php 
                    }
                }
            } else {
                ?>
										            <?php 
            }
            ?>
										            <?php 
            wp_reset_postdata();
            ?>
								
										        </div>	
										
									        <div class="cat-slider-nav">
									            <ul>    
									                <?php 
            $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $number_of_posts, 'orderby' => 'post__in', 'no_found_rows' => true, 'cache_results' => false, 'post__in' => $parent_posts));
            if ($query->have_posts()) {
                while ($query->have_posts()) {
                    $query->the_post();
                    if ($unique_posts) {
                        $do_unique_posts[] = get_the_ID();
                    }
                    ?>
									                <?php 
                    if (mom_post_image() != false) {
                        ?>
									                <li itemscope="" itemtype="http://schema.org/Article">
									                    <a href="<?php 
                        the_permalink();
                        ?>
" itemprop="url">
									                    <h2 itemprop="name"><?php 
                        short_title(47);
                        ?>
</h2>
									                    <div class="entry-meta">
									                        <time class="entry-date" datetime="<?php 
                        the_time('c');
                        ?>
" itemprop="dateCreated"><?php 
                        the_time('Y/m/d');
                        ?>
</time>
									                        <div class="author-link">
									                            <?php 
                        _e('by ', 'framework');
                        ?>
<a itemprop="author" href="<?php 
                        echo get_author_posts_url(get_the_author_meta('ID'));
                        ?>
" rel="author"><?php 
                        echo get_the_author();
                        ?>
</a>
									                        </div>
									                    </div>
									                    </a>
									                </li>
									                <?php 
                    }
                    ?>
								                <?php 
                }
            } else {
                ?>
								                
								                <?php 
            }
            wp_reset_postdata();
            ?>
								            	</ul>
								        	</div>
								    </div>
								</section>
						
							<?php 
        } else {
            ?>
 <!-- Default slider --> 
		                            <section class="section <?php 
            echo $class;
            ?>
 feature_slider_<?php 
            echo $id;
            ?>
"><!--def slider-->
		                                <div class="def-slider">
		                                    <div class="def-slider-wrap momizat-custom-slider" data-srtl="<?php 
            echo $rtl;
            ?>
" data-animate_out='<?php 
            echo $animationout;
            ?>
' data-animate_in="<?php 
            echo $animationin;
            ?>
" data-autoplay="<?php 
            echo $autoplay;
            ?>
" data-timeout="<?php 
            echo $timeout;
            ?>
" data-bullets_event="<?php 
            echo $bullets_event;
            ?>
">
		                                        <?php 
            $count = 1;
            if ($display == 'cat') {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $cats, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tag') {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'tag' => $tag, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'specific') {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'post__in' => $specific, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, '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();
                    }
                    ?>
		                                        <?php 
                    if (mom_post_image() != false) {
                        ?>
		                                        <div class="def-slider-item"  data-dot="<?php 
                        echo $count;
                        ?>
" itemscope="" itemtype="http://schema.org/Article">
		                                            <a itemprop="url" href="<?php 
                        the_permalink();
                        ?>
">
		                                            	<?php 
                        $thumbsize = 'slider-thumb';
                        if (mom_option('site_width') == 'wide') {
                            $classes = get_body_class();
                            if (in_array('right-sidebar', $classes) || in_array('left-sidebar', $classes)) {
                                $thumbsize = 'big-thumb-hd';
                            }
                        }
                        mom_post_image_full($thumbsize);
                        ?>
		                                            </a>
		                                            <?php 
                        if ($cap != 'no') {
                            ?>
		                                            <div class="def-slider-cap">
		                                                <div class="def-slider-title">
		                                                    <h2 itemprop="name"><a itemprop="url" href="<?php 
                            the_permalink();
                            ?>
"><?php 
                            the_title();
                            ?>
</a></h2>
		                                                </div>
		                                                <?php 
                            if ($exc != false) {
                                ?>
						                                <p class="def-slider-desc">
						                                    <?php 
                                global $post;
                                $excerpt = $post->post_excerpt;
                                if ($excerpt == '') {
                                    $excerpt = get_the_content('');
                                }
                                echo wp_html_excerpt(strip_shortcodes($excerpt), $exc, '...');
                                ?>
						                                </p>
						                                <?php 
                            }
                            ?>
		                                            </div>
		                                            <?php 
                        }
                        ?>
		                                        </div>
		                                        <?php 
                    }
                    ?>
		                                        <?php 
                    $count++;
                }
            } else {
            }
            wp_reset_postdata();
            ?>
		                                    </div>
		                                
		                                </div>
		                            </section><!--def slider-->
					    
		               <?php 
        }
        ?>
 <!-- End Slider type -->             	
			<?php 
        $output = ob_get_contents();
        ob_end_clean();
        set_transient('mom_feature_sliders' . $id . $type . $display . $cats . $tag . $class . $orderby, $output, 60 * 60 * 24);
    }
    return $output;
}
Пример #18
0
function mom_get_pageLayout()
{
    if (is_singular()) {
        $layout = get_post_meta(get_queried_object_id(), 'mom_page_layout', TRUE);
        if (is_single()) {
            if ($layout == '') {
                $layout = mom_option('post_page_layout');
            }
        }
        if ($layout == '') {
            $layout = mom_option('main_layout');
        }
        if (is_page()) {
            if ($layout == '') {
                $layout = mom_option('page_layout');
            }
        }
        if (function_exists('is_bbpress') && is_bbpress()) {
            if ($layout == '') {
                $layout = mom_option('bbpress_layout');
            }
            if (function_exists('is_buddypress') && is_buddypress()) {
                if (get_post_meta(get_queried_object_id(), 'mom_page_layout', true) == '') {
                    $layout = mom_option('buddypress_layout');
                }
            }
        } elseif (function_exists('is_buddypress') && is_buddypress()) {
            if ($layout == '') {
                $layout = mom_option('buddypress_layout');
            }
        } else {
            if ($layout == '') {
                $layout = mom_option('main_layout');
            }
        }
    } elseif (function_exists('is_bbpress') && is_bbpress()) {
        $layout = mom_option('bbpress_layout');
        if ($layout == '') {
            $layout = mom_option('main_layout');
        }
    } elseif (function_exists('is_buddypress') && is_buddypress()) {
        $layout = mom_option('buddypress_layout');
        if ($layout == '') {
            $layout = mom_option('main_layout');
        }
    } elseif (is_archive()) {
        $layout = mom_option('category_layout');
        if ($layout == '') {
            $layout = mom_option('main_layout');
        }
    } else {
        $layout = mom_option('main_layout');
    }
    $site_width = mom_option('site_width');
    if (function_exists('is_woocommerce') && is_woocommerce()) {
        $woo_page_id = '';
        if (is_shop()) {
            $woo_page_id = get_option('woocommerce_shop_page_id');
        } elseif (is_cart()) {
            $woo_page_id = get_option('woocommerce_cart_page_id');
        } elseif (is_checkout()) {
            $woo_page_id = get_option('woocommerce_checkout_page_id');
        } elseif (is_account_page()) {
            $woo_page_id = get_option('woocommerce_myaccount_page_id');
        } else {
            $woo_page_id = get_option('woocommerce_shop_page_id');
        }
        $layout = get_post_meta($woo_page_id, 'mom_page_layout', true);
        if ($layout == '') {
            $layout = mom_option('main_layout');
        }
        return $layout;
    }
}
Пример #19
0
                <h2><?php 
_e('Related posts', 'framework');
?>
</h2>
        </header>

        <ul class="mom-related-posts clearfix">
                <?php 
global $post;
$cats = get_the_category($post->ID);
if ($cats) {
    $cat_ids = array();
    foreach ($cats as $individual_cat) {
        $cat_ids[] = $individual_cat->cat_ID;
    }
    $args = array('category__in' => $cat_ids, 'post__not_in' => array($post->ID), 'showposts' => mom_option('related_count'), 'ignore_sticky_posts' => 1, 'no_found_rows' => true, 'cache_results' => false);
    $query = new WP_Query($args);
    update_post_thumbnail_cache($query);
    if ($query->have_posts()) {
        while ($query->have_posts()) {
            $query->the_post();
            ?>
                <li itemscope="" itemtype="http://schema.org/Article">
                		<?php 
            if (mom_post_image() != false) {
                ?>
                        <figure class="post-thumbnail"><a href="<?php 
                the_permalink();
                ?>
">
                        <?php 
Пример #20
0
function mom_scrollers($atts, $content = null)
{
    global $unique_posts;
    global $do_unique_posts;
    extract(shortcode_atts(array('style' => 'sc1', 'title' => '', 'title_size' => '17', 'sub_title' => '', 'display' => 'latest', 'cats' => '', 'tags' => '', 'orderby' => '', 'number_of_posts' => '5', 'auto_play' => '3000', 'speed' => '300', 'items' => '4'), $atts));
    static $id = 75;
    $id++;
    if ($cats == 'Select a Category') {
        $cats = '';
    }
    if ($tags == 'Select a Tag') {
        $tags = '';
    }
    $output = get_transient('mom_scroller_' . $id . $style . $display . $cats . $tags . $items . $orderby);
    if ($orderby == 'rand') {
        $output = false;
    }
    if ($output == false) {
        ob_start();
        //wp_enqueue_script('owl');
        $dateformat = mom_option('date_format');
        $post_meta_hp = mom_option('post_meta_hp');
        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;
        }
        $authormeta = mom_option('post_head_author');
        $rndn = rand(0, 100);
        global $wpdb;
        $tag_ID = $wpdb->get_var("SELECT * FROM " . $wpdb->terms . " WHERE 'name' = '" . $tags . "'");
        $nb_link = '';
        if ($display == 'cats') {
            if ($title == '') {
                $nb_title = get_cat_name($cats);
                $nb_link = get_category_link($cats);
            } else {
                $nb_title = $title;
            }
        } elseif ($display == 'tags') {
            if ($title == '') {
                $nb_title = $tags;
                $nb_link = get_tag_link($tag_ID);
            } else {
                $nb_title = $title;
            }
        } else {
            $nb_title = $title;
            $nb_link = '';
        }
        if ($auto_play != '') {
            $autoplay = 'true';
        } else {
            $autoplay = 'false';
        }
        if (is_rtl()) {
            $rtl = 'true';
        } else {
            $rtl = 'false';
        }
        $link_start = '';
        $link_end = '';
        if ($nb_link != '') {
            $link_start = '<a href="' . $nb_link . '">';
            $link_end = '</a>';
        }
        ?>
                
                <?php 
        if ($style == 'sc1') {
            ?>
                                
                    <section class="section scroller-section scroller-<?php 
            echo $id;
            ?>
">
                        
                        <header class="section-header">
                        	<?php 
            if ($title_size == '17') {
                ?>
                            <h2 class="section-title"><?php 
                echo $link_start . $nb_title . $link_end;
                ?>
</h2>
                            <?php 
            } else {
                ?>
                            <h1 class="section-title2"><?php 
                echo $link_start . $nb_title . $link_end;
                ?>
</h1>
                            <?php 
            }
            ?>
                            <?php 
            if ($sub_title != '') {
                ?>
<span class="mom-sub-title"><?php 
                echo $sub_title;
                ?>
</span><?php 
            }
            ?>
                        </header>
                        
                        <div class="scroller">
                            <div class="scroller-wrap scroller-wrap-1" data-sc-auto="<?php 
            echo $autoplay;
            ?>
" data-sc-autotime="<?php 
            echo $auto_play;
            ?>
" data-sc-speed="<?php 
            echo $speed;
            ?>
" data-sc-rtl="<?php 
            echo $rtl;
            ?>
" data-items="<?php 
            echo $items;
            ?>
">
                                <?php 
            if ($display == 'cats') {
                $squery = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $cats, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tags') {
                $squery = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'tag' => $tags, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $squery = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            }
            update_post_thumbnail_cache($squery);
            if ($squery->have_posts()) {
                while ($squery->have_posts()) {
                    $squery->the_post();
                    if ($unique_posts) {
                        $do_unique_posts[] = get_the_ID();
                    }
                    $post_url = get_post_meta(get_the_ID(), 'mom_post_custom_link', true);
                    if ($post_url == '') {
                        $post_url = get_permalink();
                    }
                    ?>
                               <?php 
                    if (mom_post_image() != false) {
                        ?>
                                <div class="scroller-item" itemscope="" itemtype="http://schema.org/Article">
                                    <a itemprop="url" href="<?php 
                        echo $post_url;
                        ?>
">
                                        <figure class="post-thumbnail">
                                          <?php 
                        mom_post_image_full('scroller-thumb');
                        ?>
                                        </figure>
                                        <h2 itemprop="name"><?php 
                        the_title();
                        ?>
</h2>
                                         </a>
                                        <?php 
                        if ($post_head != 0) {
                            ?>
                                        <div class="entry-meta">
                                            <?php 
                            if ($post_head_author == 1) {
                                ?>
					    <div class="author-link">
                                                <i class="momizat-icon-user3"></i><a itemprop="author" href="<?php 
                                echo get_author_posts_url(get_the_author_meta('ID'));
                                ?>
" rel="author"><?php 
                                echo get_the_author();
                                ?>
</a>
                                            </div>
					    <?php 
                            }
                            ?>
					    <?php 
                            if ($post_head_date != 0) {
                                ?>
                                            <time class="entry-date" datetime="<?php 
                                the_time('c');
                                ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                                the_time('Y/m/d');
                                ?>
</time>
                                            <?php 
                            }
                            ?>
					    <?php 
                            if ($post_head_cat != 0) {
                                ?>
					    <div class="cat-link">
                                                <i class="momizat-icon-folder-open"></i><?php 
                                $category = get_the_category();
                                echo '<a class="category" href="' . get_category_link($category[0]->term_id) . '">' . $category[0]->cat_name . '</a>';
                                ?>
                                            </div>
					    <?php 
                            }
                            ?>
                                        </div>
                                        <?php 
                        }
                        ?>
                                </div>
                                <?php 
                    }
                    ?>
                                <?php 
                }
            } else {
            }
            wp_reset_postdata();
            ?>
                            </div>
                        </div>
                        
                    </section>
                <?php 
        } else {
            ?>
                            	
                    <section class="section scroller-section scroller-<?php 
            echo $id;
            ?>
">
                        <header class="section-header">
                            <?php 
            if ($title_size == '17') {
                ?>
                            <h2 class="section-title"><?php 
                echo $link_start . $nb_title . $link_end;
                ?>
</h2>
                            <?php 
            } else {
                ?>
                            <h1 class="section-title2"><?php 
                echo $link_start . $nb_title . $link_end;
                ?>
</h1>
                            <?php 
            }
            ?>
                            <?php 
            if ($sub_title != '') {
                ?>
<span class="mom-sub-title"><?php 
                echo $sub_title;
                ?>
</span><?php 
            }
            ?>
                        </header>
                        
                        <div class="scroller2">
                            <div class="scroller2-wrap scroller-wrap-2" data-sc2-auto="<?php 
            echo $autoplay;
            ?>
" data-sc2-autotime="<?php 
            echo $auto_play;
            ?>
" data-sc2-speed="<?php 
            echo $speed;
            ?>
" data-sc2-rtl="<?php 
            echo $rtl;
            ?>
" data-items="<?php 
            echo $items;
            ?>
">
                               <?php 
            if ($display == 'cats') {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $cats, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } elseif ($display == 'tags') {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'tag' => $tags, 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, 'no_found_rows' => true, 'cache_results' => false, 'post__not_in' => $do_unique_posts));
            } else {
                $query = new WP_Query(array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => $number_of_posts, 'orderby' => $orderby, '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();
                    }
                    $post_url = get_post_meta(get_the_ID(), 'mom_post_custom_link', true);
                    if ($post_url == '') {
                        $post_url = get_permalink();
                    }
                    ?>
                                <div class="scroller-item" itemscope="" itemtype="http://schema.org/Article">
                                    <a itemprop="url" href="<?php 
                    echo $post_url;
                    ?>
">
                                <?php 
                    if (mom_post_image() != false) {
                        ?>
                                        <figure class="post-thumbnail">
                                            <?php 
                        mom_post_image_full('scroller-thumb');
                        ?>
                                        </figure>

                                        <?php 
                    }
                    ?>
                                        <h2 itemprop="name"><?php 
                    the_title();
                    ?>
</h2>
                                    </a>
                                        <?php 
                    if ($post_head != 0) {
                        ?>
                                        <div class="entry-meta">
                                            <?php 
                        if ($post_head_author == 1) {
                            ?>
					    <div class="author-link">
                                                <i class="momizat-icon-user3"></i><a itemprop="author" href="<?php 
                            echo get_author_posts_url(get_the_author_meta('ID'));
                            ?>
" rel="author"><?php 
                            echo get_the_author();
                            ?>
</a>
                                            </div>
					    <?php 
                        }
                        ?>
					    <?php 
                        if ($post_head_date != 0) {
                            ?>
                                            <time class="entry-date" datetime="<?php 
                            the_time('c');
                            ?>
" itemprop="dateCreated"><i class="momizat-icon-calendar"></i><?php 
                            the_time('Y/m/d');
                            ?>
</time>
                                            <?php 
                        }
                        ?>
					    <?php 
                        if ($post_head_cat != 0) {
                            ?>
					    <div class="cat-link">
                                                <i class="momizat-icon-folder-open"></i><?php 
                            $category = get_the_category();
                            echo '<a class="category" href="' . get_category_link($category[0]->term_id) . '">' . $category[0]->cat_name . '</a>';
                            ?>
                                            </div>
					    <?php 
                        }
                        ?>
                                        </div>
                                <?php 
                    }
                    ?>
        
                                </div>
                                <?php 
                }
            } else {
            }
            wp_reset_postdata();
            ?>
                            </div>
                        </div>
                    </section>
          
                <?php 
        }
        ?>
	<?php 
        $output = ob_get_contents();
        ob_end_clean();
        set_transient('mom_scroller_' . $id . $style . $display . $cats . $tags . $items . $orderby, $output, 60 * 60 * 24);
    }
    return $output;
}
Пример #21
0
    }
    ?>
                    <?php 
}
?>
                    
                    <?php 
if (mom_option('cat_slider') != false) {
    if ($cat_slider != '0') {
        get_template_part('framework/includes/category-slider');
    }
}
?>
                    
                    <?php 
if (mom_option('cat_desc')) {
    $category_description = category_description();
    if (!empty($category_description)) {
        ?>
                    <section class="section cat-desc">
                    	<?php 
        echo $category_description;
        ?>
                    </section>
                    <?php 
    }
}
?>
                    <?php 
if ($layout == 'fullwidth') {
    ?>
Пример #22
0
function mom_mailchimp_subscribe()
{
    // stay away from bad guys
    $nonce = $_POST['nonce'];
    $list_id = $_POST['list_id'];
    if (!wp_verify_nonce($nonce, 'ajax-nonce')) {
        die('Nope!');
    }
    $api_key = mom_option('mailchimp_api_key');
    if ($api_key != '') {
        require MOM_FW . '/inc/mailchimp/Mailchimp.php';
        $Mailchimp = new Mom_Mailchimp($api_key);
        $Mailchimp_Lists = new Mom_Mailchimp_Lists($Mailchimp);
        if (isset($_POST['email'])) {
            $meminfo = $Mailchimp_Lists->memberInfo($list_id, array(array('email' => htmlentities($_POST['email']))));
            if ($meminfo['success_count'] == 1) {
                echo 'already';
            } else {
                $subscriber = $Mailchimp_Lists->subscribe($list_id, array('email' => htmlentities($_POST['email'])));
                if (!empty($subscriber['leid'])) {
                    echo "success";
                } else {
                    echo "fail";
                }
            }
        }
    } else {
        echo 'auth';
    }
    exit;
}
Пример #23
0
<?php

if (mom_option('unav_banner') == 1) {
    if (mom_display_logic('unav_banner_display_logic') == true) {
        $auto_close = mom_option('unav_banner_close_timeout');
        ?>
<div class="unav_banner" data-timeout="<?php 
        echo $auto_close;
        ?>
">
 <div class="inner">
   <?php 
        if (mom_option('unav_banner_close') == 1) {
            $save_state = 'tb_save_close';
            if (mom_option('unav_banner_close_save') == 1) {
                $save_state = 'tb_save_close';
            }
            echo '<a class="unav_banner_close ' . $save_state . '" href="#" data-exp="7"><i class="fa-icon-remove"></i></a>';
        }
        if (mom_option('unav_banner_content') == 1) {
            echo do_shortcode('[ad id="' . mom_option('unav_banner_ad') . '"]');
        } else {
            echo do_shortcode(mom_option('unav_banner_custom'));
        }
        ?>
 </div>
</div>
 <?php 
    }
}
Пример #24
0
function mom_mega_menu_cats_loop($object = '', $layout = '', $id = '')
{
    if ($object == '') {
        $object = $_POST['object'];
    }
    if ($layout == '') {
        $layout = isset($_POST['layout']) ? $_POST['layout'] : '';
    }
    if ($id == '') {
        $id = $_POST['id'];
    }
    if ($layout == 'horz') {
        $post_count = mom_option('cm_counter');
        $sep = '';
        $img_size = 'megamenu-thumb';
    } else {
        $post_count = mom_option('cm_counter');
        $sep = '-';
        $img_size = 'megamenu-thumb';
    }
    $output = '';
    $r = new WP_Query(array('posts_per_page' => $post_count, 'no_found_rows' => true, 'cache_results' => false, 'post_status' => 'publish', 'post_type' => 'post', 'cat' => $id));
    update_post_thumbnail_cache($r);
    if ($r->have_posts()) {
        while ($r->have_posts()) {
            $r->the_post();
            $output .= "<li><figure><a href='" . get_permalink() . "' title='" . get_the_title() . "'><img src='" . mom_post_image($img_size) . "' alt='menu' width='112' height='75'></a></figure><h2><a href='" . get_permalink() . "' title='" . get_the_title() . "'> " . get_the_title() . "</a></h2></li>";
        }
        // Reset the global $the_post as this query will have stomped on it
        wp_reset_postdata();
    }
    if (isset($_POST['id'])) {
        echo $output;
    } else {
        return $output;
    }
    if (isset($_POST['id'])) {
        exit;
    }
}
Пример #25
0
<?php

if (function_exists('is_mobile') && is_mobile() && mom_option('hide_sidebars_in_mobiles') == 1) {
    // do nothing
} else {
    $output = $el_position = $title = $width = $el_class = $sidebar_id = '';
    extract(shortcode_atts(array('el_position' => '', 'title' => '', 'width' => '1/1', 'el_class' => '', 'sidebar_id' => ''), $atts));
    if ($sidebar_id == '') {
        return null;
    }
    $el_class = $this->getExtraClass($el_class);
    ob_start();
    dynamic_sidebar($sidebar_id);
    $sidebar_value = ob_get_contents();
    ob_end_clean();
    $sidebar_value = trim($sidebar_value);
    $sidebar_value = substr($sidebar_value, 0, 3) == '<li' ? '<ul>' . $sidebar_value . '</ul>' : $sidebar_value;
    //
    $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'wpb_widgetised_column sidebar wpb_content_element' . $el_class, $this->settings['base'], $atts);
    $output .= "\n\t" . '<div class="' . $css_class . '">';
    $output .= "\n\t\t" . '<div class="wpb_wrapper">';
    $output .= wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_widgetised_column_heading'));
    $output .= "\n\t\t\t" . $sidebar_value;
    $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper');
    $output .= "\n\t" . '</div> ' . $this->endBlockComment('.wpb_widgetised_column');
    echo $output;
}
Пример #26
0
"><i class="fa-icon-flickr"></i></a></li>
	                            <?php 
    }
    ?>
	                            <?php 
    if (get_the_author_meta('dribbble', $user->ID)) {
        ?>
	                                <li class="dribble"><a href="<?php 
        the_author_meta('dribbble', $user->ID);
        ?>
"><i class="fa-icon-dribbble"></i></a></li>
	                            <?php 
    }
    ?>
	                            <?php 
    if (mom_option('email-author-box') != 0) {
        ?>
	                            <?php 
        if (get_the_author_meta('email', $user->ID)) {
            ?>
	                                <li><a href="mailto:<?php 
            the_author_meta('email', $user->ID);
            ?>
"><i class="dashicons dashicons-email-alt"></i></a></li>
	                            <?php 
        }
        ?>
	                            <?php 
    }
    ?>
	                        </ul>
Пример #27
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;
}
Пример #28
0
function mom_review_system($atts, $content = null)
{
    extract(shortcode_atts(array('id' => ''), $atts));
    ob_start();
    wp_enqueue_script('knob');
    wp_enqueue_script('momizat-review');
    //wp_enqueue_style('momizat-review-css');
    global $post;
    if ($id == '') {
        $id = $post->ID;
    }
    $styles = get_post_meta($id, '_mom_review_styles', false);
    $nostyle = array_filter($styles);
    if (empty($nostyle)) {
        $styles = array(array('style-bars'));
    }
    $units = get_post_meta($id, '_mom_review_box_units', true);
    $title = get_post_meta($id, '_mom_review_box_title', true);
    $desc = get_post_meta($id, '_mom_review_description', true);
    $summary = get_post_meta($id, '_mom_review_summary', true);
    $score_title = get_post_meta($id, '_mom_review_score_title', true);
    $user_rate = get_post_meta($id, '_mom_review_user_rate', true);
    $criterias = get_post_meta($id, '_mom_review-criterias', false);
    $voters_count = get_post_meta($id, "mom_rate_count", true);
    if (!$voters_count) {
        $voters_count = 0;
    }
    $all_scores = 0;
    $the_score = 0;
    $score = 0;
    if (is_array($criterias)) {
        foreach ($criterias[0] as $criteria) {
            $all_scores += 100;
            $score += $criteria['cr_score'];
        }
    }
    $the_score = $score / $all_scores * 100;
    $int_score = round($the_score);
    $stars = $int_score / 20;
    $points = $int_score / 10;
    $the_score = $int_score;
    $rs_suffix = '';
    $print_score = $the_score;
    if ($units == 'points') {
        $print_score = $points;
    }
    if ($units == 'percent') {
        $rs_suffix = '%';
    }
    if ($the_score != '') {
        ?>
<div style="display:none;">
  <div itemscope itemtype="http://data-vocabulary.org/Review">
    <span itemprop="itemreviewed"><?php 
        the_title();
        ?>
</span>
    <?php 
        _e('Reviewed by', 'framework');
        ?>
<span itemprop="reviewer"><?php 
        echo get_the_author_meta('display_name');
        ?>
</span> <?php 
        _e('on', 'framework');
        ?>
    <time itemprop="dtreviewed" datetime="<?php 
        the_time('Y-m-d');
        ?>
"><?php 
        the_time('F d');
        ?>
</time>.
    <span itemprop="summary"><?php 
        if ($summary) {
            echo $summary;
        }
        ?>
</span>
    <span itemprop="description"><?php 
        if ($desc) {
            echo $desc;
        }
        ?>
</span>
    <?php 
        _e('Rating', 'framework');
        ?>
: <span itemprop="rating"><?php 
        echo $stars;
        ?>
</span>
  </div>
</div>


<div class="mom-reveiw-system">
    <header class="review-header">
        <h2><?php 
        if ($title) {
            echo $title;
        } else {
            _e('Review Overview', 'framework');
        }
        ?>
</h2>
        <ul class="mr-types">
		<?php 
        foreach ($styles[0] as $rs) {
            if ($rs == 'style-bars') {
                echo '<li class="bars"><i class="brankic-icon-chart5"></i></li>';
            } elseif ($rs == 'style-stars') {
                echo '<li class="stars"><i class="fa-icon-star-half-full"></i></li>';
            } else {
                echo '<li class="circles"><i class="brankic-icon-chart2"></i></li>';
            }
            ?>
	    <?php 
        }
        ?>
        </ul>
    </header>
 <?php 
        foreach ($styles[0] as $rs) {
            if ($rs == 'style-bars') {
                ?>
<div class="review-tab bars-tab">
    <div class="review-content">
	<?php 
                if ($desc) {
                    ?>
        <div class="review-desc">
		<?php 
                    echo do_shortcode($desc);
                    ?>
        </div>
	<?php 
                }
                ?>
    
    <div class="review-area">

            <div class="review-bars">
		<?php 
                foreach ($criterias[0] as $criteria) {
                    $cr_score = $criteria['cr_score'];
                    if ($units == 'points') {
                        $cr_score = $cr_score / 10;
                    }
                    ?>
            <div class="mom-bar">
                <div class="mb-inner" style="width:<?php 
                    echo $criteria['cr_score'];
                    ?>
%; background: <?php 
                    echo $criteria['cr_bg'];
                    ?>
;">
			<span class="cr" style="color:<?php 
                    if (isset($criteria['cr_txt'])) {
                        echo $criteria['cr_txt'];
                    }
                    ?>
;"><?php 
                    echo $criteria['cr_name'];
                    ?>
</span>
			<span class="mb-score" style="color: <?php 
                    echo $criteria['cr_bg'];
                    ?>
;"><?php 
                    echo $cr_score;
                    echo $rs_suffix;
                    ?>
</span>
                </div>
            </div>
	    <?php 
                }
                ?>
        
        
        </div>
    </div>
    
    <div class="review-summary">
        <div class="review-score">
            <div class="score-wrap bars-score">
                <span class="score"><?php 
                echo $print_score;
                echo $rs_suffix;
                ?>
</span>
                <span class="score-title"><?php 
                if ($score_title) {
                    echo $score_title;
                }
                ?>
</span>
            </div>
        </div>
	<?php 
                if ($summary) {
                    ?>
		<?php 
                    echo do_shortcode($summary);
                    ?>
	<?php 
                }
                ?>

    </div>
    </div> <!-- review-content -->
    <?php 
                if (isset($user_rate) && $user_rate == 'on') {
                    ?>
    <footer class="review-footer">
        <div class="user-rate bars">
            <h3  class="mom_user_rate_title"><strong class="your_rate" style="display:none;"><?php 
                    _e('Your Rating:', 'framework');
                    ?>
</strong><strong class="user_rate"><?php 
                    _e('User Rating:', 'framework');
                    ?>
</strong></h3>
	    <div class="user-rate-bar">
            	<?php 
                    echo momizat_getPostRate($id, 'bars');
                    ?>
	    </div>
            <span class="total-votes">(<span class="tv-count"><?php 
                    echo $voters_count;
                    ?>
</span> <?php 
                    _e('votes', 'framework');
                    ?>
)</span>
        </div>
    </footer> <!-- footer -->
    <?php 
                }
                ?>
    </div> <!-- bars tab -->
<?php 
            } elseif ($rs == 'style-stars') {
                ?>
    <!-- Stars Tab -->
    <div class="review-tab stars-tab">
    <div class="review-content">
	<?php 
                if ($desc) {
                    ?>
        <div class="review-desc">
		<?php 
                    echo do_shortcode($desc);
                    ?>
        </div>
	<?php 
                }
                ?>
    
    <div class="review-area">
        <div class="mom-stars">
		<?php 
                foreach ($criterias[0] as $criteria) {
                    $cr_score = $criteria['cr_score'];
                    ?>
            <div class="stars-cr">
		<?php 
                    $txt_color = isset($criteria['cr_txt']) ? $criteria['cr_txt'] : '';
                    if ($txt_color == '') {
                        $txt_color = isset($criteria['cr_bg']) ? $criteria['cr_bg'] : '';
                    }
                    ?>
                <span class="cr" style="color:<?php 
                    echo $txt_color;
                    ?>
;"><?php 
                    echo $criteria['cr_name'];
                    ?>
</span>
                <div class="star-rating mom_review_score" style="color:<?php 
                    echo $criteria['cr_bg'];
                    ?>
;"><span style="width:<?php 
                    echo $criteria['cr_score'];
                    ?>
%; color: <?php 
                    echo $criteria['cr_bg'];
                    ?>
;"></span></div>
	    </div>
	    <?php 
                }
                ?>
        </div>
    </div> <!-- review area -->
    
    <div class="review-summary">
        <div class="review-score">
            <div class="score-wrap stars-score">
                <div class="star-rating mom_review_score"><span style="width:<?php 
                echo $int_score;
                ?>
%"></span></div>                    
                <span class="score-title"><?php 
                if ($score_title) {
                    echo $score_title;
                }
                ?>
</span>
            </div>
        </div>
	<?php 
                if ($summary) {
                    ?>
		<?php 
                    echo do_shortcode($summary);
                    ?>
	<?php 
                }
                ?>
    </div>
    </div> <!-- review-content -->
    <?php 
                if (isset($user_rate) && $user_rate == 'on') {
                    ?>
    <footer class="review-footer">
        <div class="user-rate bars user-star-rate">
            <h3  class="mom_user_rate_title"><strong class="your_rate" style="display:none;"><?php 
                    _e('Your Rating:', 'framework');
                    ?>
</strong><strong class="user_rate"><?php 
                    _e('User Rating:', 'framework');
                    ?>
</strong></h3>
            <div class="user-rate-bar">
		<?php 
                    echo momizat_getPostRate($id);
                    ?>
	    </div>
            <span class="total-votes">(<span class="tv-count"><?php 
                    echo $voters_count;
                    ?>
</span> <?php 
                    _e('votes', 'framework');
                    ?>
)</span>
        </div>
    </footer> <!-- footer -->
    <?php 
                }
                ?>
    </div> <!-- stars tab -->    
    <?php 
            } else {
                ?>
    <!-- Circles Bar  -->
        <div class="review-tab circles-tab">
    <div class="review-content">
	<?php 
                if ($desc) {
                    ?>
        <div class="review-desc">
		<?php 
                    echo do_shortcode($desc);
                    ?>
        </div>
	<?php 
                }
                ?>
    
    <div class="review-area">
        <div class="review-circles">
		<?php 
                foreach ($criterias[0] as $criteria) {
                    $cr_score = $criteria['cr_score'];
                    if ($units == 'points') {
                        $cr_score = $cr_score / 10;
                    }
                    $td_color = '#eee';
                    if (mom_option('mom_color_skin') == 'black') {
                        $td_color = '#2D2F2F';
                    }
                    $fd_color = '#4A525D';
                    if (mom_option('mom_color_skin') == 'black') {
                        $fd_color = '#111';
                    }
                    ?>
            <div class="review-circle">
		<div class="circle">
 <input type="text" class="rc-value" data-width="147" data-height="90" data-angleArc="200" data-angleOffset="-100" data-readOnly="true" value="<?php 
                    echo $criteria['cr_score'];
                    ?>
" data-thickness=".25" data-fgColor="<?php 
                    echo isset($criteria['cr_bg']) ? $criteria['cr_bg'] : '#78bce7';
                    ?>
" data-bgColor="<?php 
                    echo $td_color;
                    ?>
">
                    <span class="val" style="color:<?php 
                    echo $criteria['cr_bg'];
                    ?>
;"><?php 
                    echo $cr_score;
                    echo $rs_suffix;
                    ?>
</span>
                </div>
		<?php 
                    $txt_color = isset($criteria['cr_txt']) ? $criteria['cr_txt'] : '';
                    if ($txt_color == '') {
                        $txt_color = isset($criteria['cr_bg']) ? $criteria['cr_bg'] : '';
                    }
                    ?>
		
                <span class="cr" style="color:<?php 
                    echo $txt_color;
                    ?>
;"><?php 
                    echo $criteria['cr_name'];
                    ?>
</span>
            </div> <!-- circle -->
		<?php 
                }
                ?>
        </div><!-- circles -->
    </div>
    
    <div class="review-summary">
        <div class="review-score">
            <div class="score-wrap circles-score">

            <div class="review-circle">
                <div class="circle">
                    <input type="text" class="rc-value" data-width="122" data-height="76" data-angleArc="200" data-angleOffset="-100" data-readOnly="true" value="<?php 
                echo $the_score;
                ?>
" data-thickness=".25" data-fgcolor="<?php 
                echo $fd_color;
                ?>
" data-bgColor="<?php 
                echo $td_color;
                ?>
">
		    
		    <span class="val"><?php 
                echo $print_score;
                echo $rs_suffix;
                ?>
</span>
                </div>
                <span class="cr"><?php 
                if ($score_title) {
                    echo $score_title;
                }
                ?>
</span>
            </div> <!-- circle -->
	    
            </div>
        </div>
	<?php 
                if ($summary) {
                    ?>
		<?php 
                    echo do_shortcode($summary);
                    ?>
	<?php 
                }
                ?>

    </div>
    </div> <!-- review-content -->
    <?php 
                if (isset($user_rate) && $user_rate == 'on') {
                    ?>
    <footer class="review-footer">
        <div class="user-rate">
            <h3  class="mom_user_rate_title"><strong class="your_rate" style="display:none;"><?php 
                    _e('Your Rating:', 'framework');
                    ?>
</strong><strong class="user_rate"><?php 
                    _e('User Rating:', 'framework');
                    ?>
</strong></h3>
            <div class="user-rate-circle">
		<?php 
                    echo momizat_getPostRate($id, 'circles');
                    ?>
            </div>
            <span class="total-votes">(<span class="tv-count"><?php 
                    echo $voters_count;
                    ?>
</span> <?php 
                    _e('votes', 'framework');
                    ?>
)</span>
        </div>
    </footer> <!-- footer -->
    <?php 
                }
                ?>
    </div> <!-- Circles tab -->
    <?php 
            }
        }
        // end foreach
        ?>
</div> <!-- mom Review -->
<?php 
    }
    $content = ob_get_contents();
    ob_end_clean();
    return $content;
}
Пример #29
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;
}
Пример #30
0
    function widget($args, $instance)
    {
        extract($args);
        /* User-selected settings. */
        $title = apply_filters('widget_title', $instance['title']);
        $orderby = $instance['orderby'];
        $count = $instance['count'];
        $display = $instance['display'];
        $cats = isset($instance['cats']) ? $instance['cats'] : array();
        $layout = isset($instance['layout']) ? $instance['layout'] : '';
        $sidebar_size = isset($instance['sidebar_size']) ? $instance['sidebar_size'] : '';
        $tag = isset($instance['tag']) ? $instance['tag'] : '';
        $output = get_transient('mom-posts-widget-' . $this->id);
        if ($orderby == 'random') {
            $output = false;
        }
        if ($output == false) {
            ob_start();
            /* Before widget (defined by themes). */
            echo $before_widget;
            /* Title of widget (before and after defined by themes). */
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            ?>
		<ul class="post-list jw2 <?php 
            echo $layout;
            ?>
">

		<?php 
            global $unique_posts;
            global $do_unique_posts;
            $dateformat = mom_option('date_format');
            $post_meta_hp = mom_option('post_meta_hp');
            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;
            }
            if ($orderby == 'popular') {
                if ($display == 'cats') {
                    $catsi = implode(',', $cats);
                    $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, "orderby" => "comment_count", 'cat' => $catsi);
                } elseif ($display == 'tag') {
                    $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, "orderby" => "comment_count", 'tag' => $tag);
                } else {
                    $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, "orderby" => "comment_count");
                }
            } elseif ($orderby == 'random') {
                if ($display == 'cats') {
                    $catsi = implode(',', $cats);
                    $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, "orderby" => "rand", 'cat' => $catsi);
                } elseif ($display == 'tag') {
                    $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, "orderby" => "rand", 'tag' => $tag);
                } else {
                    $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, "orderby" => "rand");
                }
            } elseif ($orderby == 'views') {
                $views_key = 'post_views_count';
                if (function_exists('the_views')) {
                    $views_key = 'views';
                }
                if ($display == 'cats') {
                    $catsi = implode(',', $cats);
                    $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, 'cat' => $catsi, 'meta_key' => $views_key, 'orderby' => 'meta_value_num', 'order' => 'DESC');
                } elseif ($display == 'tag') {
                    $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, 'tag' => $tag, 'meta_key' => $views_key, 'orderby' => 'meta_value_num', 'order' => 'DESC');
                } else {
                    $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, 'meta_key' => $views_key, 'orderby' => 'meta_value_num', 'order' => 'DESC');
                }
            } else {
                if ($display == 'cats') {
                    $catsi = implode(',', $cats);
                    $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, 'cat' => $catsi);
                } elseif ($display == 'tag') {
                    $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts, 'tag' => $tag);
                } else {
                    $args = array("ignore_sticky_posts" => 1, 'posts_per_page' => $count, 'cache_results' => false, 'no_found_rows' => true, 'post__not_in' => $do_unique_posts);
                }
            }
            // JWOOL - added for custom post types
            $args['post_type'] = array('post', 'appearance', 'program');
            $query = new WP_Query($args);
            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();
                    }
                    if ($sidebar_size == 'small') {
                        $img_size = 'postlist-thumb';
                        if ($layout == 'full') {
                            $img_size = 'postlist-thumb';
                        }
                    } elseif ($sidebar_size == 'big') {
                        $img_size = 'postpicwid-thumb';
                        if ($layout == 'full') {
                            $img_size = 'sliderwidget-thumb';
                        }
                    } else {
                        $img_size = 'postlist-thumb';
                        if ($layout == 'full') {
                            $img_size = 'sliderwidget-thumb';
                        }
                    }
                    ?>
			<li itemscope="" itemtype="http://schema.org/Article">
				<?php 
                    if (mom_post_image() != false) {
                        ?>
				<figure class="post-thumbnail"><a itemprop="url" href="<?php 
                        the_permalink();
                        ?>
" rel="bookmark">
				<?php 
                        mom_post_image_full($img_size);
                        ?>
				</a></figure>
				<?php 
                    }
                    ?>
				<h2 itemprop="name"><a itemprop="url" href="<?php 
                    the_permalink();
                    ?>
" rel="bookmark"><?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 
                            the_time($dateformat);
                            ?>
</time>
				    <?php 
                        }
                        ?>
				    <?php 
                        if ($post_head_commetns != 0) {
                            ?>
				    <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>
				    <?php 
                        }
                        ?>
				</div>
				<?php 
                    }
                    ?>
				<a href="<?php 
                    the_permalink();
                    ?>
" class="read-more-link"><?php 
                    _e('Read more...', 'framework');
                    ?>
</a>
			</li>

			<?php 
                }
                ?>
			<?php 
            } else {
                ?>
			<!-- Else in here -->
			<?php 
            }
            ?>
			<?php 
            wp_reset_query();
            ?>
                                    </ul>
<?php 
            /* After widget (defined by themes). */
            echo $after_widget;
            $output = ob_get_contents();
            ob_end_clean();
            set_transient('mom-posts-widget-' . $this->id, $output, 60 * 60 * 24);
        }
        echo $output;
    }