правки test1

This commit is contained in:
2026-04-05 22:24:45 +03:00
parent 4ba4a1e8f9
commit f72b5b0a39
5 changed files with 23 additions and 13 deletions

View File

@@ -224,7 +224,7 @@ add_action( 'init', 'twentytwentyfour_pattern_categories' );
* @return string
*/
function twentytwentyfour_test1_template( $template ) {
if ( ! is_page( 'test1' ) ) {
if ( ! is_front_page() && ! is_page( 'test1' ) ) {
return $template;
}
@@ -406,7 +406,7 @@ add_filter( 'template_include', 'twentytwentyfour_shop_template', 20 );
* @return void
*/
function twentytwentyfour_test1_assets() {
$use_test1_assets = is_page( array( 'test1', 'faq', 'contacts', 'delivery', 'service' ) );
$use_test1_assets = is_front_page() || is_page( array( 'test1', 'faq', 'contacts', 'delivery', 'service' ) );
if ( ! $use_test1_assets ) {
return;
@@ -559,6 +559,16 @@ function twentytwentyfour_seo_context_page_id() {
return 0;
}
if ( is_front_page() ) {
$test1_page = get_page_by_path( 'test1' );
if ( $test1_page instanceof WP_Post ) {
return (int) $test1_page->ID;
}
return (int) get_queried_object_id();
}
if ( is_page( array( 'test1', 'faq', 'contacts', 'delivery', 'service' ) ) ) {
return (int) get_queried_object_id();
}
@@ -991,7 +1001,7 @@ function twentytwentyfour_water_delivery_empty_cart_cta() {
return;
}
?>
<div class="water-empty-cart-cta"><a class="button" href="<?php echo esc_url( home_url( '/test1/#catalog' ) ); ?>"><?php esc_html_e( 'Перейти в каталог', 'twentytwentyfour' ); ?></a></div>
<div class="water-empty-cart-cta"><a class="button" href="<?php echo esc_url( home_url( '/#catalog' ) ); ?>"><?php esc_html_e( 'Перейти в каталог', 'twentytwentyfour' ); ?></a></div>
<?php
}