Exemplo n.º 1
0
define(URL_PRO, 'knob.chemaclass.com');
define(URL_DEV, 'knob.chemaclass.com');
define(URL_LOC, 'knob.chemaclass.local');
// SOME DIRECTORIES
define(PUBLIC_DIR, get_template_directory_uri() . '/public');
define(COMPONENTS_DIR, get_template_directory_uri() . '/vendor/components');
// BLOG_INFO
function getBlogTitle()
{
    if (is_home()) {
        return get_bloginfo('name');
    } else {
        return wp_title("-", false, "right") . " " . get_bloginfo('name');
    }
}
define(BLOG_TITLE, getBlogTitle());
define(ADMIN_EMAIL, get_bloginfo('admin_email'));
// --------------------------------------------------------------
// Actions
// --------------------------------------------------------------
Actions::adminPrintScripts();
Actions::adminPrintStyles();
Actions::loginView();
Actions::wpBeforeAdminBarRender();
// --------------------------------------------------------------
// Filters
// --------------------------------------------------------------
Filters::wpFilterTest();
/**
 * Remove the admin bar in prod
 */
Exemplo n.º 2
0
function showBreadcrumbs($args = array())
{
    global $wp_query, $post;
    $args = array_merge(array('home' => '', 'home_url' => '', 'show_all_filters' => true, 'show_all_posts' => true, 'truncate_title' => 0, 'truncate_add' => '...', 'echo' => true), is_array($args) ? $args : array('home' => $args));
    $rez = '';
    $rez2 = '';
    $rez_all = '';
    $type = getBlogType();
    $title = getShortString(getBlogTitle(), $args['truncate_title'], $args['truncate_add']);
    $cat = '';
    $parentTax = '';
    if (!in_array($type, array('home', 'frontpage'))) {
        $need_reset = true;
        $parent = 0;
        $post_id = 0;
        if ($type == 'page' || $type == 'attachment') {
            $pageParentID = isset($wp_query->post->post_parent) ? $wp_query->post->post_parent : 0;
            $post_id = $type == 'page' ? isset($wp_query->post->ID) ? $wp_query->post->ID : 0 : $pageParentID;
            while ($pageParentID > 0) {
                $pageParent = get_post($pageParentID);
                $rez2 = '<li class="cat_post"><a href="' . get_permalink($pageParent->ID) . '">' . getShortString($pageParent->post_title, $args['truncate_title'], $args['truncate_add']) . '</a></li>' . $rez2;
                if (($pageParentID = $pageParent->post_parent) > 0) {
                    $page_id = $pageParentID;
                }
            }
        } else {
            if ($type == 'single') {
                $post_id = isset($wp_query->post->ID) ? $wp_query->post->ID : 0;
            }
        }
        $depth = 0;
        $ex_cats = explode(',', get_theme_option('exclude_cats'));
        $taxonomy = themerex_strpos($type, 'woocommerce') !== false ? array('product_cat') : array('category');
        do {
            if ($depth++ == 0) {
                if (in_array($type, array('single', 'attachment', 'woocommerce_product'))) {
                    if ($type != 'woocommerce_product' && $args['show_all_filters']) {
                        $post_format = get_post_format($post_id);
                        if (($tpl_id = getTemplatePageId('only-' . $post_format)) > 0) {
                            $rez_all .= '<li class="all"><a href="' . get_permalink($tpl_id) . '">' . sprintf(__('All %s', 'themerex'), getPostFormatName($post_format, false)) . '</a></li>';
                        }
                    }
                    $cats = getCategoriesByPostId($post_id, $taxonomy);
                    $cat = $cats ? $cats[0] : false;
                    if ($cat) {
                        if (!in_array($cat['term_id'], $ex_cats)) {
                            $cat_link = get_term_link($cat['slug'], $cat['taxonomy']);
                            $rez2 = '<li class="cat_post"><a href="' . $cat_link . '">' . getShortString($cat['name'], $args['truncate_title'], $args['truncate_add']) . '</a></li>' . $rez2;
                        }
                    } else {
                        $post_type = get_post_type($post_id);
                        $parentTax = 'category' . ($post_type == 'post' ? '' : '_' . $post_type);
                    }
                } else {
                    if ($type == 'category') {
                        $cat = get_term_by('id', get_query_var('cat'), 'category', ARRAY_A);
                    } else {
                        if (themerex_strpos($type, 'woocommerce') !== false) {
                            if (is_product_category()) {
                                $cat = get_term_by('slug', get_query_var('product_cat'), 'product_cat', ARRAY_A);
                            }
                        }
                    }
                }
                if ($cat) {
                    $parent = $cat['parent'];
                    $parentTax = $cat['taxonomy'];
                }
            }
            if ($parent) {
                $cat = get_term_by('id', $parent, $parentTax, ARRAY_A);
                if ($cat) {
                    if (!in_array($cat['term_id'], $ex_cats)) {
                        $cat_link = get_term_link($cat['slug'], $cat['taxonomy']);
                        $rez2 = '<li class="cat_parent"><a href="' . $cat_link . '">' . getShortString($cat['name'], $args['truncate_title'], $args['truncate_add']) . '</a></li>' . $rez2;
                    }
                    $parent = $cat['parent'];
                }
            }
        } while ($parent);
        if (themerex_strpos($type, 'woocommerce') !== false && !in_array(themerex_strtolower($title), array('shop')) && ($shop_id = get_option('woocommerce_shop_page_id')) > 0) {
            $rez_all = '<li class="all"><a href="' . get_permalink($shop_id) . '">' . __('Shop', 'themerex') . '</a></li>' . $rez_all;
        }
        if ($args['show_all_posts'] && !in_array(themerex_strtolower($title), array('all posts')) && ($blog_id = getTemplatePageId('template-blog')) > 0) {
            $rez_all = '<li class="all"><a href="' . get_permalink($blog_id) . '">' . __('All Posts', 'themerex') . '</a></li>' . $rez_all;
        }
        $rez3 = '';
        if (themerex_strpos($type, 'woocommerce') === false && is_archive() && is_object($post)) {
            $year = get_the_time('Y');
            $month = get_the_time('m');
            if (is_day() || is_month()) {
                $rez3 .= '<li class="cat_parent"><a href="' . get_year_link($year) . '">' . $year . '</a></li>';
            }
            if (is_day()) {
                $rez3 .= '<li class="cat_parent"><a href="' . get_month_link($year, $month) . '">' . prepareDateForTranslation(get_the_date('F')) . '</a></li>';
            }
        }
        if (!is_front_page()) {
            // && !is_home()
            $rez .= '<ul class="breadcrumbs">' . (isset($args['home']) && $args['home'] != '' ? '<li class="home"><a href="' . ($args['home_url'] ? $args['home_url'] : home_url()) . '">' . $args['home'] . '</a></li>' : '') . $rez_all . $rez2 . $rez3 . ($title ? '<li class="current">' . $title . '</li>' : '') . '</ul>';
        }
    }
    if ($args['echo'] && !empty($rez)) {
        echo $rez;
    }
    return $rez;
}
Exemplo n.º 3
0
							<?php 
    }
    ?>
							<?php 
    if (get_custom_option('show_page_title') == 'yes') {
        if (get_custom_option('show_post_title') == 'yes' && is_singular()) {
            ?>
								<div class="pageTitle h1"><?php 
            echo esc_html(getBlogTitle());
            ?>
</div>
									<?php 
        } else {
            ?>
								<h1 class="pageTitle h1"><?php 
            echo esc_html(getBlogTitle());
            ?>
</h1>
							<?php 
        }
    }
    ?>
						</div>
					</div>
			<?php 
}
?>

			<div class="mainWrap <?php 
if (function_exists('is_woocommerce') ? is_product() : false) {
    echo "without_sidebar woocommerce_product";
Exemplo n.º 4
0
        ?>
								<div class="speedBar">
									<?php 
        if (!is_404()) {
            showBreadcrumbs();
        }
        ?>
								</div>
							<?php 
    }
    ?>
							<?php 
    if (get_custom_option('show_page_title') == 'yes') {
        ?>
								<h3 class="pageTitle h3"><?php 
        echo getBlogTitle();
        ?>
</h3>
							<?php 
    }
    ?>
							<?php 
    if (get_custom_option('show_sidebar_top') == 'yes') {
        ?>
							<div class="tabsButton">
								<ul>
									<li><a href="#tabBlog"><span><?php 
        echo is_archive() ? __('Blog', 'themerex') : __('Home', 'themerex');
        ?>
</span></a></li>
								</ul>
Exemplo n.º 5
0
	<?php 
}
?>
	<?php 
if (get_custom_option('slider_show') == 'yes') {
    //slider
    get_template_part('templates/page-part-slider');
} else {
    if (get_custom_option('header_image') != '') {
        //header image
        echo balanceTags('<div class="sc_header_image" style="background-image: url(' . get_custom_option('header_image') . ');"></div>');
    }
}
//category title & description
if (sc_param_is_on(get_custom_option('description_lable_show'))) {
    $catTitle = getBlogTitle();
    $catDescription = '';
    if (get_custom_option('description_lable') != '') {
        $catDescription = get_queried_object()->category_description ? get_queried_object()->category_description : '';
    }
    if ($catDescription == '' && get_custom_option('description_lable') != '') {
        $catDescription = get_custom_option('description_lable');
    }
    if ($catTitle || $catDescription) {
        ?>
			<div class="subCategory">
				<h1><?php 
        echo esc_attr($catTitle);
        ?>
</h1> <?php 
        echo balanceTags($catDescription ? '<div class="categoryDescription">' . esc_attr($catDescription) . '</div>' : '');
Exemplo n.º 6
0
// URL ENVEROMENTS
define('URL_PRO', isset($env['pro']) ? $env['pro'] : $siteUrl);
define('URL_DEV', isset($env['dev']) ? $env['dev'] : $siteUrl);
define('URL_LOC', isset($env['loc']) ? $env['loc'] : $siteUrl);
// SOME DIRECTORIES
define('PUBLIC_DIR', get_template_directory_uri() . '/public');
define('COMPONENTS_DIR', get_template_directory_uri() . '/vendor/components');
// BLOG_INFO
function getBlogTitle()
{
    if (is_home()) {
        return get_bloginfo('name');
    } else {
        return wp_title("-", false, "right") . " " . get_bloginfo('name');
    }
}
define('BLOG_TITLE', getBlogTitle());
define('ADMIN_EMAIL', get_bloginfo('admin_email'));
// --------------------------------------------------------------
// Actions
// --------------------------------------------------------------
Actions::setup();
// --------------------------------------------------------------
// Filters
// --------------------------------------------------------------
Filters::setup();
// --------------------------------------------------------------
// WidgetController
// --------------------------------------------------------------
Widgets::setup();
@(include_once 'test.php');