我发现了这个thread,它准确地描述了我的问题,但是我尝试了解决方法,但它不起作用。
这是我的front-page.php代码:
<?php
get_header();
/* Wrapper start */
echo '<div class="main">';
$big_title = get_stylesheet_directory() . '/inc/shop_isle_big_title_section.php';
load_template( apply_filters( 'shop-isle-subheader', $big_title ) );
这是我的shop_isle_big_title_section.php:
<?php
/**
* Big title section
*
* @package ShopIsle
* @since 1.0.0
*/
$shop_isle_homepage_slider_shortcode = get_theme_mod( 'shop_isle_homepage_slider_shortcode' );
$shop_isle_big_title_hide = get_theme_mod( 'shop_isle_big_title_hide' );
if ( isset( $shop_isle_big_title_hide ) && $shop_isle_big_title_hide != 1 ) {
echo '<section id="home" class="home-section home-parallax home-fade' . ( empty( $shop_isle_homepage_slider_shortcode ) ? ' home-full-height' : ' home-slider-plugin' ) . '">';
} elseif ( is_customize_preview() ) {
echo '<section id="home" class="home-section home-parallax home-fade shop_isle_hidden_if_not_customizer' . ( empty( $shop_isle_homepage_slider_shortcode ) ? ' home-full-height' : ' home-slider-plugin' ) . '">';
}
if ( ! empty( $shop_isle_homepage_slider_shortcode ) ) {
echo do_shortcode( $shop_isle_homepage_slider_shortcode );
} else {
$shop_isle_big_title_image = get_theme_mod( 'shop_isle_big_title_image', get_template_directory_uri() . '/assets/images/background-video.jpg' );
$shop_isle_big_title_title = get_theme_mod( 'shop_isle_big_title_title', 'Test' );
$shop_isle_big_title_subtitle = get_theme_mod( 'shop_isle_big_title_subtitle', __( 'WooCommerce Theme', 'shop-isle' ) );
if ( ! empty( $shop_isle_big_title_image ) ) {
echo '<div class="hero-slider">';
echo '<ul class="slides">';
//echo '<li class="bg-dark" style="background-image:url(' . esc_url( $shop_isle_big_title_image ) . ')">';
echo '<div class="home-slider-overlay"></div>';
echo '<div class="hs-caption">';
echo '<div class="caption-content">';
if ( ! empty( $shop_isle_big_title_title ) ) {
echo '<h1 class="hs-title-size-4 font-alt mb-30">Test Custom</h1>';
} elseif ( is_customize_preview() ) {
echo '<h1 class="hs-title-size-4 font-alt mb-30"></h1>';
}
if ( ! empty( $shop_isle_big_title_subtitle ) ) {
echo '<div class="hs-title-size-1 font-alt mb-40">Custom Sub</div>';
} elseif ( is_customize_preview() ) {
echo '<div class="hs-title-size-1 font-alt mb-40"></div>';
}
shop_isle_big_title_section_display_button();
echo '</div><!-- .caption-content -->';
echo '</div><!-- .hs-caption -->';
echo '</li><!-- .bg-dark -->';
echo '</ul><!-- .slides -->';
echo '</div><!-- .hero-slider -->';
}
}// End if().
echo '</section >';
如您所见,大标题通常应显示文本“ Test Custom”和“ Custom sub”,并且没有背景,而没有背景。我希望有人能看到我做错了。我想要的是显示我的更改,但在这种情况下不显示(是的,我的孩子主题正常运行)。