Anton | натяжка страницы test1
This commit is contained in:
@@ -204,3 +204,73 @@ if ( ! function_exists( 'twentytwentyfour_pattern_categories' ) ) :
|
||||
endif;
|
||||
|
||||
add_action( 'init', 'twentytwentyfour_pattern_categories' );
|
||||
|
||||
/**
|
||||
* Use a standalone PHP template for the page slug "test1".
|
||||
*
|
||||
* @since Twenty Twenty-Four 1.0
|
||||
*
|
||||
* @param string $template Resolved template path.
|
||||
* @return string
|
||||
*/
|
||||
function twentytwentyfour_test1_template( $template ) {
|
||||
if ( ! is_page( 'test1' ) ) {
|
||||
return $template;
|
||||
}
|
||||
|
||||
$custom_template = get_theme_file_path( 'page-test1.php' );
|
||||
|
||||
if ( file_exists( $custom_template ) ) {
|
||||
return $custom_template;
|
||||
}
|
||||
|
||||
return $template;
|
||||
}
|
||||
add_filter( 'template_include', 'twentytwentyfour_test1_template' );
|
||||
|
||||
/**
|
||||
* Enqueue standalone landing assets for the page slug "test1".
|
||||
*
|
||||
* @since Twenty Twenty-Four 1.0
|
||||
* @return void
|
||||
*/
|
||||
function twentytwentyfour_test1_assets() {
|
||||
if ( ! is_page( 'test1' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$css_file = ABSPATH . 'index3.css';
|
||||
$js_file = ABSPATH . 'index3.js';
|
||||
|
||||
wp_dequeue_style( 'global-styles' );
|
||||
wp_dequeue_style( 'wp-block-library' );
|
||||
wp_dequeue_style( 'wp-block-library-theme' );
|
||||
wp_dequeue_style( 'classic-theme-styles' );
|
||||
|
||||
wp_enqueue_style(
|
||||
'twentytwentyfour-test1-fonts',
|
||||
'https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&display=swap',
|
||||
array(),
|
||||
null
|
||||
);
|
||||
|
||||
if ( file_exists( $css_file ) ) {
|
||||
wp_enqueue_style(
|
||||
'twentytwentyfour-test1-style',
|
||||
home_url( '/index3.css' ),
|
||||
array( 'twentytwentyfour-test1-fonts' ),
|
||||
(string) filemtime( $css_file )
|
||||
);
|
||||
}
|
||||
|
||||
if ( file_exists( $js_file ) ) {
|
||||
wp_enqueue_script(
|
||||
'twentytwentyfour-test1-script',
|
||||
home_url( '/index3.js' ),
|
||||
array(),
|
||||
(string) filemtime( $js_file ),
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', 'twentytwentyfour_test1_assets', 100 );
|
||||
|
||||
Reference in New Issue
Block a user