Beispiel #1
0
/**
 * The template used for displaying Modules Tabs content
 *
 */
?>

<?php 
$mod_id = get_the_ID();
// Get Sidebar Position
$header_layout = esc_attr(get_post_meta($mod_id, 'quadro_mod_header_layout', true));
$overlay = esc_attr(get_post_meta($mod_id, 'quadro_mod_overlay', true));
$titles = get_post_meta($mod_id, 'quadro_mod_tabs_titles', true);
// Query for the Modules Tabs Modules
$args = array('post_type' => 'quadro_mods', 'posts_per_page' => -1, 'no_found_rows' => true, 'update_post_term_cache' => false);
// Bring picked posts if there are some
$args = quadro_add_selected_posts($mod_id, 'quadro_mod_tabs_modules', $args);
$mod_query = new WP_Query($args);
?>

<section id="post-<?php 
the_ID();
?>
" class="quadro-mod type-tabs clear <?php 
quadro_mod_parallax($mod_id);
?>
 overlay-<?php 
echo $overlay;
?>
">

	<?php 
?>

<?php 
// Retrieve Theme Options
global $quadro_options;
$mod_id = get_the_ID();
// Get Sidebar Position
$header_layout = esc_attr(get_post_meta($mod_id, 'quadro_mod_header_layout', true));
$overlay = esc_attr(get_post_meta($mod_id, 'quadro_mod_overlay', true));
$sidebar_pos = esc_attr(get_post_meta($mod_id, 'quadro_mod_wrapper_sidebar', true));
$sidebar_pick = esc_attr(get_post_meta($mod_id, 'quadro_mod_wrapper_sidebar_pick', true));
$sidebar_pick = $sidebar_pick != '' ? $sidebar_pick : 'main-sidebar';
// Query for the Modules Wrapper Modules
$args = array('post_type' => 'quadro_mods', 'posts_per_page' => -1, 'no_found_rows' => true, 'update_post_term_cache' => false);
// Bring picked posts if there are some
$args = quadro_add_selected_posts($mod_id, 'quadro_mod_wrapper_modules', $args);
$mod_query = new WP_Query($args);
?>

<section id="post-<?php 
the_ID();
?>
" class="quadro-mod type-wrapper sidebar-<?php 
echo $sidebar_pos;
?>
 clear <?php 
quadro_mod_parallax($mod_id);
?>
 overlay-<?php 
echo $overlay;
?>
} elseif ($picker_method == 'tax') {
    // Bring Selected Categories
    $selected_terms = esc_attr(get_post_meta($mod_id, 'quadro_mod_portfolio_terms', true));
    if ($selected_terms != '') {
        $selected_terms = explode(', ', $selected_terms);
        // Add tax query to query arguments
        $args['tax_query'] = array(array('taxonomy' => 'portfolio_tax', 'field' => 'id', 'terms' => $selected_terms));
        $args['orderby'] = $order_by;
        $args['order'] = $order;
    }
} elseif ($picker_method == 'custom') {
    // Bring Selected Items
    $selected_items = esc_attr(get_post_meta($mod_id, 'quadro_mod_portfolio_picker', true));
    $selected_items = explode(',', $selected_items);
    // Bring picked posts if there are some
    $args = quadro_add_selected_posts($mod_id, 'quadro_mod_portfolio_picker', $args);
}
$wp_query = new WP_Query($args);
?>

<section id="post-<?php 
the_ID();
?>
" class="quadro-mod type-portfolio portfolio-<?php 
echo $portfolio_style;
?>
 portfolio-layout-<?php 
echo $portfolio_layout;
?>
 <?php 
echo $portfolio_columns;
// Now, let's get all the display posts
$args = array('post_type' => array('post', 'product'), 'posts_per_page' => $items_perpage, 'offset' => $offset, 'no_found_rows' => true, 'post__not_in' => explode(',', $exclude));
// Modify Query depending on the selected Show Method
if ($picker_method == 'tax') {
    // Bring Selected Categories
    $sel_terms = esc_attr(get_post_meta($mod_id, 'quadro_mod_display_terms', true));
    if ($sel_terms != '') {
        // Add tax query to query arguments
        $args['cat'] = $sel_terms;
    }
} elseif ($picker_method == 'format') {
    // Bring selected post formats
    $args = quadro_add_selected_formats($mod_id, 'quadro_mod_display_formats', $args);
} elseif ($picker_method == 'custom') {
    // Bring picked posts if there are some
    $args = quadro_add_selected_posts($mod_id, 'quadro_mod_pick_display', $args);
}
$display_posts = new WP_Query($args);
?>

<section id="post-<?php 
the_ID();
?>
" class="quadro-mod type-display <?php 
quadro_mod_parallax($mod_id);
?>
 <?php 
echo $mod_margins;
?>
 modheader-<?php 
echo $header_layout;
					</div>
				</header><!-- .page-header -->
				<?php 
}
?>

				<?php 
// Call Transients Fragment Cache
qi_fragment_cache('modpage' . get_the_ID(), 7 * DAY_IN_SECONDS, function () {
    ?>

					<?php 
    // Query for the Modular Template Modules
    $args = array('post_type' => 'quadro_mods', 'posts_per_page' => -1, 'no_found_rows' => true, 'update_post_term_cache' => false);
    // Bring selected modules for this page
    $args = quadro_add_selected_posts(get_the_ID(), 'quadro_mod_temp_modules', $args);
    $quadro_mods = new WP_Query($args);
    ?>
					
					<?php 
    if ($quadro_mods->have_posts()) {
        while ($quadro_mods->have_posts()) {
            $quadro_mods->the_post();
            ?>
							
						<?php 
            // Retrieve Module type
            $mod_type = esc_attr(get_post_meta(get_the_ID(), 'quadro_mod_type', true));
            ?>
						<?php 
            // and call the template for it
$offset = esc_attr(get_post_meta($mod_id, 'quadro_mod_videoposts_offset', true));
$exclude = esc_attr(get_post_meta($mod_id, 'quadro_mod_videoposts_exclude', true));
$items_perpage = $items_perpage != '' ? $items_perpage : 200;
// Now, let's get all the slides
$args = array('tax_query' => array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => 'post-format-video')), 'posts_per_page' => $items_perpage, 'offset' => $offset, 'no_found_rows' => true, 'post__not_in' => explode(',', $exclude));
// Modify Query depending on the selected Show Method
if ($picker_method == 'tax') {
    // Bring Selected Categories
    $sel_terms = esc_attr(get_post_meta($mod_id, 'quadro_mod_videoposts_terms', true));
    if ($sel_terms != '') {
        // Add tax query to query arguments
        $args['cat'] = $sel_terms;
    }
} elseif ($picker_method == 'custom') {
    // Bring picked posts if there are some
    $args = quadro_add_selected_posts($mod_id, 'quadro_mod_pick_videoposts', $args);
}
$videoposts = new WP_Query($args);
?>

<section id="post-<?php 
the_ID();
?>
" class="quadro-mod type-videoposts clear <?php 
quadro_mod_parallax($mod_id);
?>
 modheader-<?php 
echo $header_layout;
?>
 overlay-<?php 
echo $overlay;
// Now, let's get all the flashnews posts
$args = array('post_type' => array('post'), 'posts_per_page' => $items_perpage, 'offset' => $offset, 'no_found_rows' => true, 'post__not_in' => explode(',', $exclude));
// Modify Query depending on the selected Show Method
if ($picker_method == 'tax') {
    // Bring Selected Categories
    $sel_terms = esc_attr(get_post_meta($mod_id, 'quadro_mod_flashnews_terms', true));
    if ($sel_terms != '') {
        // Add tax query to query arguments
        $args['cat'] = $sel_terms;
    }
} elseif ($picker_method == 'format') {
    // Bring selected post formats
    $args = quadro_add_selected_formats($mod_id, 'quadro_mod_flashnews_formats', $args);
} elseif ($picker_method == 'custom') {
    // Bring picked posts if there are some
    $args = quadro_add_selected_posts($mod_id, 'quadro_mod_pick_flashnews', $args);
}
$home_flashnews = new WP_Query($args);
?>

<section id="post-<?php 
the_ID();
?>
" class="quadro-mod type-flashnews <?php 
quadro_mod_parallax($mod_id);
?>
 modheader-<?php 
echo $header_layout;
?>
 overlay-<?php 
echo $overlay;
$text_color = esc_attr(get_post_meta($mod_id, 'quadro_mod_quoteposts_color', true));
$items_perpage = esc_attr(get_post_meta($mod_id, 'quadro_mod_quoteposts_pper', true));
$items_perpage = $items_perpage != '' ? $items_perpage : -1;
// Now, let's get all the slides
$args = array('tax_query' => array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => 'post-format-quote')), 'no_found_rows' => true, 'posts_per_page' => $items_perpage);
// Modify Query depending on the selected Show Method
if ($picker_method == 'tax') {
    // Bring Selected Categories
    $sel_terms = esc_attr(get_post_meta($mod_id, 'quadro_mod_quoteposts_terms', true));
    if ($sel_terms != '') {
        // Add tax query to query arguments
        $args['cat'] = $sel_terms;
    }
} elseif ($picker_method == 'custom') {
    // Bring picked posts if there are some
    $args = quadro_add_selected_posts($mod_id, 'quadro_mod_pick_quoteposts', $args);
}
$quoteposts = new WP_Query($args);
?>

<section id="post-<?php 
the_ID();
?>
" class="quadro-mod type-quoteposts clear <?php 
quadro_mod_parallax($mod_id);
?>
 modheader-<?php 
echo $header_layout;
?>
 overlay-<?php 
echo $overlay;
// Now, let's get the Featured post
$args = array('post_type' => array('post', 'quadro_portfolio'), 'posts_per_page' => 1, 'offset' => $offset, 'no_found_rows' => true, 'post__not_in' => explode(',', $exclude));
// Modify Query depending on the selected Show Method
if ($picker_method == 'tax') {
    // Bring Selected Categories
    $sel_terms = esc_attr(get_post_meta($mod_id, 'quadro_mod_featured_terms', true));
    if ($sel_terms != '') {
        // Add tax query to query arguments
        $args['cat'] = $sel_terms;
    }
} elseif ($picker_method == 'format') {
    // Bring selected post formats
    $args = quadro_add_selected_formats($mod_id, 'quadro_mod_featured_formats', $args);
} elseif ($picker_method == 'custom') {
    // Bring picked posts if there are some
    $args = quadro_add_selected_posts($mod_id, 'quadro_mod_pick_featured', $args);
}
$featured_post = new WP_Query($args);
?>

<section id="post-<?php 
the_ID();
?>
" class="quadro-mod type-featured <?php 
quadro_mod_parallax($mod_id);
?>
 modheader-<?php 
echo $header_layout;
?>
 overlay-<?php 
echo $overlay;
// Now, let's get all the carousel posts
$args = array('post_type' => array('post', 'product'), 'posts_per_page' => $items_perpage, 'offset' => $offset, 'no_found_rows' => true, 'post__not_in' => explode(',', $exclude));
// Modify Query depending on the selected Show Method
if ($picker_method == 'tax') {
    // Bring Selected Categories
    $sel_terms = esc_attr(get_post_meta($mod_id, 'quadro_mod_carousel_terms', true));
    if ($sel_terms != '') {
        // Add tax query to query arguments
        $args['cat'] = $sel_terms;
    }
} elseif ($picker_method == 'format') {
    // Bring selected post formats
    $args = quadro_add_selected_formats($mod_id, 'quadro_mod_carousel_formats', $args);
} elseif ($picker_method == 'custom') {
    // Bring picked posts if there are some
    $args = quadro_add_selected_posts($mod_id, 'quadro_mod_pick_carousel', $args);
}
$home_carousel = new WP_Query($args);
?>

<section id="post-<?php 
the_ID();
?>
" class="quadro-mod type-carousel <?php 
quadro_mod_parallax($mod_id);
?>
 <?php 
echo $mod_margins;
?>
 modheader-<?php 
echo $header_layout;
Beispiel #11
0
    $args['post__not_in'] = explode(',', $exclude);
}
// Modify Query depending on the selected Show Method
if ($picker_method == 'tax') {
    // Bring Selected Categories
    $sel_terms = esc_attr(get_post_meta($mod_id, 'quadro_mod_blog_terms', true));
    if ($sel_terms != '') {
        // Add tax query to query arguments
        $args['cat'] = $sel_terms;
    }
} elseif ($picker_method == 'format') {
    // Bring selected post formats
    $args = quadro_add_selected_formats($mod_id, 'quadro_mod_blog_formats', $args);
} elseif ($picker_method == 'custom') {
    // Bring picked posts if there are some
    $args = quadro_add_selected_posts($mod_id, 'quadro_mod_pick_blog', $args);
}
$wp_query = new WP_Query($args);
?>

<section id="post-<?php 
the_ID();
?>
" class="quadro-mod type-blog clear blog-style-<?php 
echo $blog_layout;
?>
 masonry-margins-<?php 
echo $blog_margins;
?>
 <?php 
quadro_mod_parallax($mod_id);
    $args['post__not_in'] = explode(',', $exclude);
}
// Modify Query depending on the selected Show Method
if ($picker_method == 'tax') {
    // Bring Selected Categories
    $sel_terms = esc_attr(get_post_meta($mod_id, 'quadro_mod_magazine_terms', true));
    if ($sel_terms != '') {
        // Add tax query to query arguments
        $args['cat'] = $sel_terms;
    }
} elseif ($picker_method == 'format') {
    // Bring selected post formats
    $args = quadro_add_selected_formats($mod_id, 'quadro_mod_magazine_formats', $args);
} elseif ($picker_method == 'custom') {
    // Bring picked posts if there are some
    $args = quadro_add_selected_posts($mod_id, 'quadro_mod_pick_magazine', $args);
}
$magazine_posts = new WP_Query($args);
?>

<section id="post-<?php 
the_ID();
?>
" class="quadro-mod type-magazine magazine-<?php 
echo $layout;
?>
 mag-columns-<?php 
echo $columns;
?>
 <?php 
quadro_mod_parallax($mod_id);
Beispiel #13
0
// Now, let's get all the slider posts
$args = array('post_type' => array('post'), 'posts_per_page' => $items_perpage, 'offset' => $offset, 'no_found_rows' => true, 'post__not_in' => explode(',', $exclude));
// Modify Query depending on the selected Show Method
if ($picker_method == 'tax') {
    // Bring Selected Categories
    $sel_terms = esc_attr(get_post_meta($mod_id, 'quadro_mod_pslider_terms', true));
    if ($sel_terms != '') {
        // Add tax query to query arguments
        $args['cat'] = $sel_terms;
    }
} elseif ($picker_method == 'format') {
    // Bring selected post formats
    $args = quadro_add_selected_formats($mod_id, 'quadro_mod_pslider_formats', $args);
} elseif ($picker_method == 'custom') {
    // Bring picked posts if there are some
    $args = quadro_add_selected_posts($mod_id, 'quadro_mod_pick_pslider', $args);
}
$quadro_slides = new WP_Query($args);
?>

<section id="post-<?php 
the_ID();
?>
" class="quadro-mod caption-<?php 
echo $caption_style;
?>
 caption-<?php 
echo $caption_pos;
?>
 type-pslider clear <?php 
quadro_mod_parallax($mod_id);