Example #1
0
*
* Override this template by copying it to yourtheme/woocommerce/archive-product.php
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
*/
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
$is_ajax = !empty($_POST["ajax"]) ? true : false;
$shop_page_id = get_option('woocommerce_shop_page_id');
$hide_page_title = (bool) get_field('hide_page_title', $shop_page_id);
$page_container_no_padding = (bool) get_field('page_container_no_padding', $shop_page_id);
$full_width_page = xt_page_has_composer($shop_page_id);
$paginate_method = xt_option('paginate_method');
$attr[] = 'data-paginate="' . esc_attr($paginate_method) . '"';
$load_more_class = $paginate_method;
if ($paginate_method == 'paginate_scroll') {
    $paginate_method = "paginate_more";
}
if ($is_ajax) {
    ?>
					
	<?php 
    while (have_posts()) {
        the_post();
        wc_get_template_part('content', 'product');
    }
    ?>
Example #2
0
    $taxonomy = 'post_tag';
    $term = get_term_by('slug', get_query_var('tag'), $taxonomy);
    $archive_content = "";
} elseif (!empty($post_type_object->label)) {
    if (isset($wp_query->queried_object) && isset($wp_query->queried_object->ID)) {
        $archive_title = get_the_title($wp_query->queried_object->ID);
        $archive_content = apply_filters('the_content', $wp_query->queried_object->post_content);
        $hide_page_title = (bool) get_field('hide_page_title', $wp_query->queried_object->ID);
        $page_container_no_padding = (bool) get_field('page_container_no_padding', $wp_query->queried_object->ID);
        $full_width_page = xt_page_has_composer($wp_query->queried_object);
    } else {
        $archive_title = get_the_title($post->ID);
        $archive_content = apply_filters('the_content', $post->post_content);
        $hide_page_title = get_field('hide_page_title', $post->ID);
        $page_container_no_padding = (bool) get_field('page_container_no_padding', $post->ID);
        $full_width_page = xt_page_has_composer($post);
    }
}
if (!empty($term) && !is_wp_error($term)) {
    $archive_title = $term->name;
    $attr[] = 'data-taxonomy="' . $taxonomy . '"';
    $attr[] = 'data-term="' . $term->term_id . '"';
}
$paginate_method = xt_option('paginate_method');
$attr[] = 'data-paginate="' . $paginate_method . '"';
$attr[] = 'data-template="' . $item_template . '"';
$load_more_class = $paginate_method;
if ($paginate_method == 'paginate_scroll') {
    $paginate_method = "paginate_more";
}
/**
Example #3
0
<?php

/**
 * Setup Dynamic Sidebar
 */
$page_id = xt_get_page_ID();
list($has_sidebar, $sidebar_position, $sidebar_area) = xt_setup_dynamic_sidebar($page_id);
$hide_page_title = (bool) get_field('hide_page_title', $page_id);
$page_container_no_padding = (bool) get_field('page_container_no_padding', $page_id);
$has_composer = xt_page_has_composer();
$special_page = xt_page_is_special();
$full_width_page = $has_composer;
$current_page_title = get_the_title();
get_header();
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
	

<div class="row<?php 
        echo !empty($full_width_page) ? ' full-width' : '';
        echo $has_sidebar ? ' has-sidebar' : '';
        ?>
">
 
	<div class="medium-<?php 
        echo $has_sidebar ? '8' : '12';
        ?>
  column<?php 
        echo $sidebar_position === 'left' ? ' right' : '';
Example #4
0
/**
 * Check if comments are enabled
 */
function xt_comments_enabled()
{
    global $post;
    $post_type = get_post_type();
    $post_id = get_the_ID();
    if (!empty($post_id)) {
        $comments_enabled = (bool) xt_option('comments_enabled') && comments_open($post_id);
    } else {
        $comments_enabled = (bool) xt_option('comments_enabled');
    }
    if ($post_type == 'page') {
        $comments_on_pages = (bool) xt_option('comments_on_pages');
        $comments_enabled = !$comments_on_pages ? false : $comments_enabled;
    }
    if (!empty($post_id) && xt_page_has_composer($post_id)) {
        $comments_on_vc_pages = (bool) xt_option('comments_on_vc_pages');
        $comments_enabled = !$comments_on_vc_pages ? false : $comments_enabled;
    }
    return $comments_enabled;
}