我在Wordpress网站TofBallogs上有一个下拉菜单。也就是说,由于某种原因,当我单击然后下拉时,它不会以我认为应该的方式加载到手机上,我无法找出导致它的原因,我附上了一张图片,说明我认为它应该是什么样子以及它实际上是什么样子的,如果能提供任何帮助,我将不胜感激。(请参见图1)请注意apple slide掌上菜单,但我的另一个下拉菜单不会产生相同的效果(请参见图2)。


更新:跟踪到导致问题的实际文件,似乎是selectWoo。js文件
然后,我尝试用以下代码将脚本出列
add_action( \'wp_enqueue_scripts\', \'agentwp_dequeue_stylesandscripts\', 100 );
function agentwp_dequeue_stylesandscripts() {
if ( class_exists( \'woocommerce\' ) ) {
wp_dequeue_style( \'selectWoo\' );
wp_deregister_style( \'selectWoo\' );
wp_dequeue_script( \'selectWoo\');
wp_deregister_script(\'selectWoo\');
}
}
但代码似乎没有效果?我还发现了与公认答案相同的堆栈溢出代码解决方案,并进行了大量的升级投票,也许代码已经过时了?
https://stackoverflow.com/questions/28547598/how-to-unload-select2-script-styles-loaded-by-new-woocommerce-2-3-x/47314703