Removing the vertical one page template and function
This commit is contained in:
parent
29ee19b65f
commit
a38a20c3da
|
@ -47,7 +47,3 @@ if ( $is_woocommerce ) {
|
||||||
echo $html;
|
echo $html;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,6 @@
|
||||||
* @package understrap
|
* @package understrap
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ( ! function_exists( 'understrap_scripts' ) ) {
|
if ( ! function_exists( 'understrap_scripts' ) ) {
|
||||||
/**
|
/**
|
||||||
* Load theme's JavaScript sources.
|
* Load theme's JavaScript sources.
|
||||||
|
@ -20,30 +18,6 @@ if ( ! function_exists( 'understrap_scripts' ) ) {
|
||||||
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
|
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
|
||||||
wp_enqueue_script( 'comment-reply' );
|
wp_enqueue_script( 'comment-reply' );
|
||||||
}
|
}
|
||||||
|
|
||||||
// menu - vertical page association
|
|
||||||
// do not load on WooCommerce pages
|
|
||||||
// do not load if we are in WooCommerce pages.
|
|
||||||
$loadit = true;
|
|
||||||
if ( class_exists( 'WooCommerce' ) ) {
|
|
||||||
if ( is_woocommerce() ) {
|
|
||||||
$loadit = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( ( is_page_template ( 'page-templates/vertical-one-page.php' ) || is_home() || is_single() ) && $loadit ) {
|
|
||||||
wp_enqueue_script( 'vertical-one-page', get_template_directory_uri() . '/js/vertical-one-page.js',
|
|
||||||
array( 'jquery' ), true );
|
|
||||||
$page_for_posts = strtolower( get_the_title( get_option( 'page_for_posts' ) ) );
|
|
||||||
$home_url = home_url();
|
|
||||||
$is_single = is_single();
|
|
||||||
$vars = array(
|
|
||||||
'pageForPosts' => $page_for_posts,
|
|
||||||
'homeUrl' => $home_url,
|
|
||||||
'isSingle' => $is_single,
|
|
||||||
);
|
|
||||||
wp_localize_script( 'vertical-one-page', 'vars', $vars );
|
|
||||||
}
|
|
||||||
// menu - vertical page association end.
|
|
||||||
}
|
}
|
||||||
} // endif function_exists( 'understrap_scripts' ).
|
} // endif function_exists( 'understrap_scripts' ).
|
||||||
|
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
/**
|
|
||||||
* Vertical page navigation
|
|
||||||
* A temporary source file providing smooth scrolling navigation to Pages
|
|
||||||
*/
|
|
||||||
(function( $ ) {
|
|
||||||
var currentPage = location.href;
|
|
||||||
var adjustedHeight = $( 'body' ).hasClass( 'admin-bar' ) ? 36 : 0;
|
|
||||||
var blogPage = vars.homeUrl + '/' + vars.pageForPosts;
|
|
||||||
if ( currentPage.substr( -1 ) === '/' ) {
|
|
||||||
currentPage = currentPage.substr( 0, currentPage.length - 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
$( document ).ready(function() {
|
|
||||||
// smoothly scroll to an ID
|
|
||||||
$( '#main-menu li a' ).click( function ( e ) {
|
|
||||||
var target;
|
|
||||||
// if not on root URL
|
|
||||||
if ( currentPage === blogPage || vars.isSingle ) {
|
|
||||||
target = $(this);
|
|
||||||
target = vars.homeUrl + '/' + target[0].hash;
|
|
||||||
location = target;
|
|
||||||
}
|
|
||||||
target = $( this.hash );
|
|
||||||
target = target.length ? target : $( '[name=' + this.hash.slice(1) + ']' );
|
|
||||||
if ( target.length ) {
|
|
||||||
|
|
||||||
$( 'html, body' ).delay( 100 ).animate({
|
|
||||||
scrollTop: target.offset().top - adjustedHeight
|
|
||||||
}, 800);
|
|
||||||
// put the hash in location bar
|
|
||||||
window.history.pushState( null, null, e.delegateTarget.href );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})( jQuery );
|
|
|
@ -1,70 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Template Name: Vertical One Page
|
|
||||||
*
|
|
||||||
* Template for displaying a page without sidebar even if a sidebar widget is published
|
|
||||||
*
|
|
||||||
* @package understrap
|
|
||||||
*/
|
|
||||||
|
|
||||||
get_header();
|
|
||||||
$container = get_theme_mod( 'understrap_container_type' );
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Exclude the posts page from being shown in this layout.
|
|
||||||
* Order pages by their order number.
|
|
||||||
*/
|
|
||||||
$exclude = 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__not_in' => $exclude,
|
|
||||||
'orderby' => 'menu_order',
|
|
||||||
'order' => 'ASC',
|
|
||||||
);
|
|
||||||
|
|
||||||
$qry = new WP_Query( $args );
|
|
||||||
?>
|
|
||||||
|
|
||||||
<div class="wrapper" id="full-width-page-wrapper">
|
|
||||||
|
|
||||||
<div class="<?php echo esc_html( $container ); ?>" id="content">
|
|
||||||
|
|
||||||
<div class="col-md-12 content-area" id="primary">
|
|
||||||
|
|
||||||
<main class="site-main" id="main" role="main">
|
|
||||||
|
|
||||||
<?php if ( have_posts() ) : while ( $qry->have_posts() ) : $qry->the_post() ?>
|
|
||||||
<div class="page">
|
|
||||||
<?php get_template_part( 'loop-templates/content', 'verticalpage' ); ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php wp_reset_postdata(); // reset custom query. ?>
|
|
||||||
<?php
|
|
||||||
endwhile;
|
|
||||||
endif;
|
|
||||||
?>
|
|
||||||
|
|
||||||
</main><!-- #main -->
|
|
||||||
|
|
||||||
</div><!-- #primary -->
|
|
||||||
|
|
||||||
</div><!-- Container end -->
|
|
||||||
|
|
||||||
</div><!-- Wrapper end -->
|
|
||||||
|
|
||||||
<?php get_footer(); ?>
|
|
Reference in New Issue