do not show woocommerce pages on vertical template

This commit is contained in:
Stef Kariotidis 2016-11-19 00:15:39 +02:00
parent 33602b1d74
commit 8e7e24a899
1 changed files with 34 additions and 22 deletions

View File

@ -7,8 +7,8 @@
* @package understrap * @package understrap
*/ */
get_header(); get_header();
$container = get_theme_mod('understrap_container_type'); $container = get_theme_mod( 'understrap_container_type' );
?> ?>
<?php <?php
@ -16,20 +16,32 @@
* Exclude the posts page from being shown in this layout. * Exclude the posts page from being shown in this layout.
* Order pages by their order number. * Order pages by their order number.
*/ */
$exclude = get_option( 'page_for_posts' ); $exclude = array();
$args = array( // exclude blog page
array_push($exclude, get_option( 'page_for_posts' ) );
// exclude WooCommerce pages
array_push( $exclude, get_option( 'woocommerce_cart_page_id' ) );
array_push( $exclude, get_option( 'woocommerce_shop_page_id' ) );
array_push( $exclude, get_option( 'woocommerce_checkout_page_id' ) );
array_push( $exclude, get_option( 'woocommerce_pay_page_id' ) );
array_push( $exclude, get_option( 'woocommerce_thanks_page_id' ) );
array_push( $exclude, get_option( 'woocommerce_myaccount_page_id' ) );
array_push( $exclude, get_option( 'woocommerce_edit_address_page_id' ) );
array_push( $exclude, get_option( 'woocommerce_view_order_page_id' ) );
array_push( $exclude, get_option( 'woocommerce_terms_page_id' ) );
$args = array(
'post_type' => 'page', 'post_type' => 'page',
'post__not_in' => array( $exclude ), 'post__not_in' => $exclude,
'orderby' => 'menu_order', 'orderby' => 'menu_order',
'order' => 'ASC' 'order' => 'ASC'
); );
$qry = new WP_Query( $args ); $qry = new WP_Query( $args );
?> ?>
<div class="wrapper" id="full-width-page-wrapper"> <div class="wrapper" id="full-width-page-wrapper">
<div class="<?php echo $container?>" id="content"> <div class="<?php echo $container ?>" id="content">
<div class="col-md-12 content-area" id="primary"> <div class="col-md-12 content-area" id="primary">