правки test1
This commit is contained in:
@@ -41,6 +41,12 @@
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.test1-shared-shop-page {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.test1-shared-cart-page .site-main {
|
||||
flex: 1 0 auto;
|
||||
}
|
||||
@@ -61,6 +67,11 @@
|
||||
padding-bottom: 26px;
|
||||
}
|
||||
|
||||
.test1-shared-shop-page .site-main {
|
||||
flex: 1 0 auto;
|
||||
padding-bottom: 26px;
|
||||
}
|
||||
|
||||
.test1-shared-cart-page .classic-footer {
|
||||
margin-top: auto;
|
||||
}
|
||||
@@ -78,6 +89,10 @@
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.test1-shared-shop-page .classic-footer {
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.test1-shared-shell .site-header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
|
||||
@@ -366,6 +366,29 @@ function twentytwentyfour_cart_template( $template ) {
|
||||
}
|
||||
add_filter( 'template_include', 'twentytwentyfour_cart_template', 20 );
|
||||
|
||||
/**
|
||||
* Use a lightweight custom template for the WooCommerce shop page.
|
||||
*
|
||||
* @since Twenty Twenty-Four 1.0
|
||||
*
|
||||
* @param string $template Resolved template path.
|
||||
* @return string
|
||||
*/
|
||||
function twentytwentyfour_shop_template( $template ) {
|
||||
if ( ! function_exists( 'is_shop' ) || ! is_shop() ) {
|
||||
return $template;
|
||||
}
|
||||
|
||||
$custom_template = get_theme_file_path( 'page-shop.php' );
|
||||
|
||||
if ( file_exists( $custom_template ) ) {
|
||||
return $custom_template;
|
||||
}
|
||||
|
||||
return $template;
|
||||
}
|
||||
add_filter( 'template_include', 'twentytwentyfour_shop_template', 20 );
|
||||
|
||||
/**
|
||||
* Enqueue standalone landing assets for the page slug "test1".
|
||||
*
|
||||
@@ -465,7 +488,7 @@ add_action( 'wp_enqueue_scripts', 'twentytwentyfour_test1_assets', 100 );
|
||||
* @return void
|
||||
*/
|
||||
function twentytwentyfour_test1_shared_shell_assets() {
|
||||
if ( ! ( ( function_exists( 'is_checkout' ) && is_checkout() && ! is_order_received_page() ) || ( function_exists( 'is_cart' ) && is_cart() ) || is_page( 'faq' ) || is_page( 'contacts' ) || is_page( 'delivery' ) || is_page( 'service' ) ) ) {
|
||||
if ( ! ( ( function_exists( 'is_checkout' ) && is_checkout() && ! is_order_received_page() ) || ( function_exists( 'is_cart' ) && is_cart() ) || ( function_exists( 'is_shop' ) && is_shop() ) || is_page( 'faq' ) || is_page( 'contacts' ) || is_page( 'delivery' ) || is_page( 'service' ) ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
33
wp-content/themes/twentytwentyfour/page-shop.php
Normal file
33
wp-content/themes/twentytwentyfour/page-shop.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Shop template with shared test1 header/footer.
|
||||
*
|
||||
* @package Twenty_Twenty_Four
|
||||
*/
|
||||
|
||||
?><!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?>>
|
||||
<head>
|
||||
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<?php wp_head(); ?>
|
||||
</head>
|
||||
<body <?php body_class( 'test1-shared-shell test1-shared-shop-page' ); ?>>
|
||||
<?php wp_body_open(); ?>
|
||||
<?php
|
||||
$test1_header_action_url = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : home_url( '/cart/' );
|
||||
$test1_header_action_label = __( 'Корзина', 'twentytwentyfour' );
|
||||
$test1_header_mode = 'link';
|
||||
require get_theme_file_path( 'template-parts/test1-shared-header.php' );
|
||||
?>
|
||||
|
||||
<main class="site-main" role="main">
|
||||
<div class="container">
|
||||
<?php woocommerce_content(); ?>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<?php require get_theme_file_path( 'template-parts/test1-shared-footer.php' ); ?>
|
||||
<?php wp_footer(); ?>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user