奇怪的情况与脚本产生砖石效果在我的客户的WP博客。突然之间,我在所有使用砖石脚本的页面上都出现了这个错误:
Warning: Use of undefined constant CHILD_THEME_VERSION - assumed 'CHILD_THEME_VERSION' (this will throw an Error in a future version of PHP) in /home/customer/www/writtenpalette.com/public_html/wp-content/themes/writpall/masonry.php on line 12因此,它是PHP代码的一部分,就在下面:
add_action( 'wp_enqueue_scripts', 'jmd_masonry_script' );
function jmd_masonry_script() {
if (is_home() || is_archive()) {
wp_enqueue_script( 'masonry-init', get_stylesheet_directory_uri().'/js/masonry-init.js' , array( 'jquery-masonry' ), '1.0', true );
wp_enqueue_style( 'masonry-styles', get_stylesheet_directory_uri() . '/style-masonry.css', array(), CHILD_THEME_VERSION );
}
}知道怎么纠正吗?
发布于 2020-02-26 22:55:00
即使用PHP常量。
您可以从错误消息中看出,没有定义CHILD_THEME_VERSION。
然而,有几种方法可以解决这个问题。
按- https://developer.wordpress.org/reference/functions/wp_enqueue_style/
版本是选项,默认为false。
所以下面我们有关于如何修复它的这些选项。
<代码>H 110只需删除它H 211F 212
https://stackoverflow.com/questions/60422197
复制相似问题