Ejemplo n.º 1
0
function cc_filter_product_single($content)
{
    global $post;
    $post_type = get_post_type();
    if (is_single() && 'cc_product' == $post_type) {
        wp_enqueue_script('cc-gallery-toggle', CC_URL . 'resources/js/gallery-toggle.js', 'jquery');
        $thumbs = cc_get_product_thumb_sources($post->ID);
        $images = cc_get_product_gallery_image_sources($post->ID, false);
        if (count($images) > 0) {
            $data = array('images' => $images, 'thumbs' => $thumbs);
            $single_product_view = CC_View::get(CC_PATH . 'templates/partials/single-product.php', $data);
        } else {
            $single_product_view = CC_View::get(CC_PATH . 'templates/partials/single-product-no-gallery.php');
        }
        $content = $single_product_view . $content;
    }
    return $content;
}
Ejemplo n.º 2
0
<?php

/**
 * The template used for displaying product content
 *
 * @package Reality66
 * @since 2.0
 */
$thumbs = cc_get_product_thumb_sources($post->ID);
$images = cc_get_product_gallery_image_sources($post->ID);
?>

<header class="entry-header">
    <h1 class="entry-title"><?php 
the_title();
?>
</h1>
</header>

<?php 
include_once CC_PATH . 'templates/partials/single-product.php';
?>

<div style="clear:both;"></div>

<div class="entry-content">
    <?php 
the_content();
?>
</div>