コード例 #1
0
ファイル: blogs.php プロジェクト: emtii/paula.wp
function compare_blogs_func($atts, $content)
{
    extract(shortcode_atts(array('title' => '', 'items' => '10', 'visible_items' => '2', 'blogs_orderby' => 'date', 'blogs_order' => 'DESC'), $atts));
    $html = '<div class="white-title clearfix">
				<div class="white-block-border clearfix">
					 <div class="pull-left">
						' . compare_get_white_title_icon() . '
						' . (!empty($title) ? '<h3>' . $title . '</h3>' : '') . '
					</div>
					<div class="pull-right">
						<a href="javascript:;" class="list-left">
							<i class="fa fa-angle-left"></i>
						</a>
						<a href="javascript:;" class="list-right">
							<i class="fa fa-angle-right"></i>
						</a>				
					</div>
				</div>
			</div>';
    $blogs = new WP_Query(array('post_type' => 'post', 'ignore_sticky_posts' => true, 'posts_per_page' => $items, 'post_status' => 'publish', 'orderby' => $blogs_orderby, 'order' => $blogs_order));
    if ($blogs->have_posts()) {
        $html .= '<div class="blogs-slider" data-visible_items="' . esc_attr($visible_items) . '">';
        while ($blogs->have_posts()) {
            $blogs->the_post();
            $has_media = compare_has_media();
            ob_start();
            include get_template_directory() . '/includes/blog-box.php';
            $html .= ob_get_contents();
            ob_end_clean();
        }
        $html .= '</div>';
    }
    wp_reset_postdata();
    return '<div class="owl-parent shortcode shortcode-blogs">' . $html . '</div>';
}
コード例 #2
0
ファイル: categories.php プロジェクト: emtii/paula.wp
function compare_categories_func($atts, $content)
{
    extract(shortcode_atts(array('title' => '', 'visible_items' => '', 'children' => '5', 'categories' => ''), $atts));
    $categories = explode(',', $categories);
    $html = '';
    global $COMPARE_SEARCH_URL;
    global $compare_slugs;
    if (!empty($categories)) {
        $html = '<div class="white-title clearfix">
					<div class="white-block-border clearfix">
						 <div class="pull-left">
							' . compare_get_white_title_icon() . '
							' . (!empty($title) ? '<h3>' . $title . '</h3>' : '') . '
						</div>
						<div class="pull-right">
							<a href="javascript:;" class="list-left">
								<i class="fa fa-angle-left"></i>
							</a>
							<a href="javascript:;" class="list-right">
								<i class="fa fa-angle-right"></i>
							</a>				
						</div>
					</div>
				</div>
				<div class="white-block categories"><div class="categories-slider" data-visible_items="' . esc_attr($visible_items) . '">';
        foreach ($categories as $category) {
            $term = get_term_by('slug', $category, 'product-cat');
            if (!is_wp_error($term)) {
                $term_meta = get_option('taxonomy_' . $term->term_id);
                $style = '';
                if (!empty($term_meta['category_image'])) {
                    $image_data = wp_get_attachment_image_src($term_meta['category_image'], 'full');
                    if (!empty($image_data[0])) {
                        $style = 'background-image: url(' . $image_data[0] . ')';
                    }
                }
                $children_terms = get_terms('product-cat', array('parent' => $term->term_id, 'hide_empty' => false, 'number' => $children));
                $children_list = array();
                if (!is_wp_error($children_terms)) {
                    foreach ($children_terms as $child) {
                        $children_list[] = '<a href="' . esc_url(add_query_arg(array($compare_slugs['product-cat'] => $child->slug), $COMPARE_SEARCH_URL)) . '">' . $child->name . '</a>';
                    }
                }
                $html .= '<div style="' . esc_attr($style) . '" class="category-item"><h5><a href="' . esc_url(add_query_arg(array($compare_slugs['product-cat'] => $term->slug), $COMPARE_SEARCH_URL)) . '">' . $term->name . '</a></h5><p>' . join(', ', $children_list) . '</p></div>';
            }
        }
        $html .= '</div></div>';
    }
    return '<div class="owl-parent shortcode shortcode-categories">' . $html . '</div>';
}
コード例 #3
0
ファイル: 404.php プロジェクト: emtii/paula.wp
<?php

get_header();
?>
<section>
	<div class="container">
		<div class="white-block">
            <div class="white-title clearfix">
				<div class="white-block-border clearfix">
					 <div class="pull-left">
						<?php 
echo compare_get_white_title_icon();
?>
						<h3><?php 
_e('404 Error Page', 'compare');
?>
</h3>
					</div>
				</div>
            </div>  		
			<div class="error-image">
				<?php 
$error_img = compare_get_option('error_img');
if (!empty($error_img['url'])) {
    echo '<img src="' . esc_url($error_img['url']) . '" width="' . esc_attr($error_img['width']) . '" height="' . esc_attr($error_img['height']) . '" alt="404">';
}
?>
			</div>
			<p><?php 
_e('Sorry but this post or page does not exists!', 'compare');
?>
コード例 #4
0
ファイル: products.php プロジェクト: keymech/keymech
function compare_products_func($atts, $content)
{
    extract(shortcode_atts(array('tabs' => '', 'products' => '10', 'rows' => '2', 'visible_items' => '4'), $atts));
    $tabs = explode(',', $tabs);
    $navigation = '<ul class="nav nav-tabs" role="tablist">';
    $panels = '<div class="tab-content">';
    $active_first = false;
    if (!empty($tabs)) {
        foreach ($tabs as $tab) {
            switch ($tab) {
                case 'popular':
                    $navigation .= '<li role="presentation" class="' . (!$active_first ? 'active' : '') . '"><a href="#popular" aria-controls="popular" role="tab" data-toggle="tab">' . __('The Most Popular', 'compare') . '</a></li>';
                    $panels .= '<div role="tabpanel" class="tab-pane ' . (!$active_first ? 'active' : '') . '" id="popular"><div class="products-slider" data-visible_items="' . esc_attr($visible_items) . '">';
                    $panels .= compare_generate_products_panel('popular', $rows, $products);
                    $panels .= '</div></div>';
                    $active_first = true;
                    break;
                case 'seller':
                    $navigation .= '<li role="presentation" class="' . (!$active_first ? 'active' : '') . '"><a href="#seller" aria-controls="seller" role="tab" data-toggle="tab">' . __('Best Sellers', 'compare') . '</a></li>';
                    $panels .= '<div role="tabpanel" class="tab-pane ' . (!$active_first ? 'active' : '') . '" id="seller"><div class="products-slider" data-visible_items="' . esc_attr($visible_items) . '">';
                    $panels .= compare_generate_products_panel('seller', $rows, $products);
                    $panels .= '</div></div>';
                    $active_first = true;
                    break;
                case 'latest':
                    $navigation .= '<li role="presentation" class="' . (!$active_first ? 'active' : '') . '"><a href="#latest" aria-controls="latest" role="tab" data-toggle="tab">' . __('Latest Added', 'compare') . '</a></li>';
                    $panels .= '<div role="tabpanel" class="tab-pane ' . (!$active_first ? 'active' : '') . '" id="latest"><div class="products-slider" data-visible_items="' . esc_attr($visible_items) . '">';
                    $panels .= compare_generate_products_panel('latest', $rows, $products);
                    $panels .= '</div></div>';
                    $active_first = true;
                    break;
                case 'ratings':
                    $navigation .= '<li role="presentation" class="' . (!$active_first ? 'active' : '') . '"><a href="#ratings" aria-controls="ratings" role="tab" data-toggle="tab">' . __('Top Rated', 'compare') . '</a></li>';
                    $panels .= '<div role="tabpanel" class="tab-pane ' . (!$active_first ? 'active' : '') . '" id="ratings"><div class="products-slider" data-visible_items="' . esc_attr($visible_items) . '">';
                    $panels .= compare_generate_products_panel('ratings', $rows, $products);
                    $panels .= '</div></div>';
                    $active_first = true;
                    break;
            }
        }
    }
    $panels .= '</div>';
    $navigation .= '</ul>';
    $html = '<div class="white-title clearfix">
				<div class="white-block-border clearfix">
					<div class="pull-left">
						' . compare_get_white_title_icon() . '
						' . $navigation . '
					</div>
					<div class="pull-right">
						<a href="javascript:;" class="list-left">
							<i class="fa fa-angle-left"></i>
						</a>
						<a href="javascript:;" class="list-right">
							<i class="fa fa-angle-right"></i>
						</a>
					</div> 
				</div>
			</div>' . $panels;
    return '<div class="owl-parent shortcode shortcode-products">' . $html . '</div>';
}
コード例 #5
0
ファイル: functions.php プロジェクト: emtii/paula.wp
function compare_widgets_init()
{
    register_sidebar(array('name' => __('Blog Sidebar', 'compare'), 'id' => 'sidebar-blog', 'before_widget' => '<div class="widget white-block owl-parent %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="widget-title white-title clearfix"><div class="white-block-border clearfix">
								<div class="pull-left">' . compare_get_white_title_icon() . '
								<h3>', 'after_title' => '</h3></div>
						<div class="pull-right">
							<a href="javascript:;" class="list-left">
								<i class="fa fa-angle-left"></i>
							</a>
							<a href="javascript:;" class="list-right">
								<i class="fa fa-angle-right"></i>
							</a>
						</div></div></div>', 'description' => __('Appears on the right side of the blog.', 'compare')));
    register_sidebar(array('name' => __('Page Sidebar Right', 'compare'), 'id' => 'sidebar-right', 'before_widget' => '<div class="widget white-block owl-parent %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="widget-title white-title clearfix"><div class="white-block-border clearfix">
								<div class="pull-left">' . compare_get_white_title_icon() . '
								<h3>', 'after_title' => '</h3></div>
						<div class="pull-right">
							<a href="javascript:;" class="list-left">
								<i class="fa fa-angle-left"></i>
							</a>
							<a href="javascript:;" class="list-right">
								<i class="fa fa-angle-right"></i>
							</a>
						</div></div></div>', 'description' => __('Appears on the right side of the page.', 'compare')));
    register_sidebar(array('name' => __('Page Sidebar Left', 'compare'), 'id' => 'sidebar-left', 'before_widget' => '<div class="widget white-block owl-parent %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="widget-title white-title clearfix"><div class="white-block-border clearfix">
								<div class="pull-left">' . compare_get_white_title_icon() . '
								<h3>', 'after_title' => '</h3></div>
						<div class="pull-right">
							<a href="javascript:;" class="list-left">
								<i class="fa fa-angle-left"></i>
							</a>
							<a href="javascript:;" class="list-right">
								<i class="fa fa-angle-right"></i>
							</a>
						</div></div></div>', 'description' => __('Appears on the left side of the page.', 'compare')));
    register_sidebar(array('name' => __('Contact Page Sidebar', 'compare'), 'id' => 'sidebar-contact', 'before_widget' => '<div class="widget white-block owl-parent %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="widget-title white-title clearfix"><div class="white-block-border clearfix">
								<div class="pull-left">' . compare_get_white_title_icon() . '
								<h3>', 'after_title' => '</h3></div>
						<div class="pull-right">
							<a href="javascript:;" class="list-left">
								<i class="fa fa-angle-left"></i>
							</a>
							<a href="javascript:;" class="list-right">
								<i class="fa fa-angle-right"></i>
							</a>
						</div></div></div>', 'description' => __('Appears on the right side of the contact page.', 'compare')));
    register_sidebar(array('name' => __('Register Store Page Sidebar', 'compare'), 'id' => 'sidebar-register', 'before_widget' => '<div class="widget white-block owl-parent %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="widget-title white-title clearfix"><div class="white-block-border clearfix">
								<div class="pull-left">' . compare_get_white_title_icon() . '
								<h3>', 'after_title' => '</h3></div>
						<div class="pull-right">
							<a href="javascript:;" class="list-left">
								<i class="fa fa-angle-left"></i>
							</a>
							<a href="javascript:;" class="list-right">
								<i class="fa fa-angle-right"></i>
							</a>
						</div></div></div>', 'description' => __('Appears on the right side of the register store page.', 'compare')));
    register_sidebar(array('name' => __('Search Sidebar', 'compare'), 'id' => 'sidebar-search', 'before_widget' => '<div class="widget white-block owl-parent %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="widget-title white-title clearfix"><div class="white-block-border clearfix">
								<div class="pull-left">' . compare_get_white_title_icon() . '
								<h3>', 'after_title' => '</h3></div>
						<div class="pull-right">
							<a href="javascript:;" class="list-left">
								<i class="fa fa-angle-left"></i>
							</a>
							<a href="javascript:;" class="list-right">
								<i class="fa fa-angle-right"></i>
							</a>
						</div></div></div>', 'description' => __('Appears on the left side of the search page.', 'compare')));
    register_sidebar(array('name' => __('Product Sidebar', 'compare'), 'id' => 'sidebar-product', 'before_widget' => '<div class="widget white-block owl-parent %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="widget-title white-title clearfix"><div class="white-block-border clearfix">
								<div class="pull-left">' . compare_get_white_title_icon() . '
								<h3>', 'after_title' => '</h3></div>
						<div class="pull-right">
							<a href="javascript:;" class="list-left">
								<i class="fa fa-angle-left"></i>
							</a>
							<a href="javascript:;" class="list-right">
								<i class="fa fa-angle-right"></i>
							</a>
						</div></div></div>', 'description' => __('Appears on the right side of the product page.', 'compare')));
    register_sidebar(array('name' => __('Bottom Sidebar 1', 'compare'), 'id' => 'sidebar-bottom-1', 'before_widget' => '<div class="widget white-block owl-parent %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="widget-title"><h4>', 'after_title' => '</h4></div>', 'description' => __('Appears at the bottom of the page.', 'compare')));
    register_sidebar(array('name' => __('Bottom Sidebar 2', 'compare'), 'id' => 'sidebar-bottom-2', 'before_widget' => '<div class="widget white-block owl-parent %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="widget-title"><h4>', 'after_title' => '</h4></div>', 'description' => __('Appears at the bottom of the page.', 'compare')));
    register_sidebar(array('name' => __('Bottom Sidebar 3', 'compare'), 'id' => 'sidebar-bottom-3', 'before_widget' => '<div class="widget white-block owl-parent %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="widget-title"><h4>', 'after_title' => '</h4></div>', 'description' => __('Appears at the bottom of the page.', 'compare')));
    $home_sidebars = compare_get_option('home_sidebars');
    if (empty($home_sidebars)) {
        $home_sidebars = 2;
    }
    for ($i = 1; $i <= $home_sidebars; $i++) {
        register_sidebar(array('name' => __('Home Sidebar ', 'compare') . $i, 'id' => 'home-sidebar-' . $i, 'before_widget' => '<div class="widget white-block owl-parent %2$s">', 'after_widget' => '</div>', 'before_title' => '<div class="widget-title white-title clearfix"><div class="white-block-border clearfix">
									<div class="pull-left">' . compare_get_white_title_icon() . '
									<h3>', 'after_title' => '</h3></div>
							<div class="pull-right">
								<a href="javascript:;" class="list-left">
									<i class="fa fa-angle-left"></i>
								</a>
								<a href="javascript:;" class="list-right">
									<i class="fa fa-angle-right"></i>
								</a>
							</div></div></div>', 'description' => __('Used for the widget area on home page.', 'compare')));
    }
    $mega_menu_sidebars = compare_get_option('mega_menu_sidebars');
    if (empty($mega_menu_sidebars)) {
        $mega_menu_sidebars = 5;
    }
    for ($i = 1; $i <= $mega_menu_sidebars; $i++) {
        register_sidebar(array('name' => __('Mega Menu Sidebar ', 'compare') . $i, 'id' => 'mega-menu-' . $i, 'before_widget' => '<li class="widget white-block owl-parent %2$s">', 'after_widget' => '</li>', 'before_title' => '<div class="widget-title"><h4>', 'after_title' => '</h4></div>', 'description' => __('This will be shown as the dropdown menu in the navigation.', 'compare')));
    }
}