临时站点上的响应式设计中断

我正在建立一个临时站点,以在更改生效之前对其进行测试,但是该站点的响应式设计无法正常工作。

我停用了所有插件,但是响应式设计在舞台上仍然无法正常工作。

我创建了原始网站的新本地副本,并一个接一个地添加了插件,并且响应式设计有效,因此插件不会破坏它。

我相信我已经将问题缩小为子主题目录中functions.php中的排队代码中出现的问题

function add_theme_scripts() {

    $parent_style = 'Karma'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.

    wp_enqueue_style( $parent_style,get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'Karma-child',get_stylesheet_directory_uri() . '/style.css',array( $parent_style ),wp_get_theme()->get('Version')
    );

    wp_enqueue_script( 'script',get_stylesheet_directory_uri() . '/js/script.js',array ( 'jquery' ),1.1,true);

   if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
     wp_enqueue_script( 'comment-reply' );
   }
}

add_action( 'wp_enqueue_scripts','add_theme_scripts' );

这是实时网站:www.alliancechemical.com

这是舞台站点:www.alliancechemical.com/staging

我希望当屏幕分辨率进入移动区域时,断点媒体查询将生效并进行css调整。

dayue0618 回答:临时站点上的响应式设计中断

在活动站点上,主题css文件的版本为4.7.15,在暂存器中的版本为5.2.4,它们更改选择器的顺序。

登台时#main上的CSS:

#main.tt-slider-karma-custom-jquery-2 {
    margin-top: -189px;
}
@media only screen and (max-width: 1023px)
#main.tt-slider-karma-custom-jquery-2 {
    margin-top: -157px; //Disabled
}

实时播放#main上的CSS:

#main.tt-slider-karma-custom-jquery-2 {
    margin-top: -157px; 
}
#main.tt-slider-karma-custom-jquery-2 {
    margin-top: -189px; //Disabled
}

解决方案是注销移动css,然后再次将主题css作为依赖项使其入队。

本文链接:https://www.f2er.com/3150079.html

大家都在问