【发布时间】:2019-06-30 19:17:14
【问题描述】:
我最近一直在尝试挖掘古腾堡区块。为了进行基本设置,我一直在关注 wordpress 上的“教程”(create-guten-block 也给我带来了样式问题,所以我决定尝试自己设置)。但是,由于某种原因,这些样式不适用于我的网站前端。
我遵循了几个不同的教程来了解可能发生的情况。包括到目前为止没有运气删除“jetpack”插件。我使用了入队脚本而不是注册。我还尝试将项目拆分为不同的功能并分别添加。
文件), 数组('wp-blocks','wp-element') );
wp_register_style(
'wild-wonders-editor-style',
plugins_url( 'dist/css/editor.css', __FILE__ ),
array( 'wp-edit-blocks' ),
filemtime( plugin_dir_path( __FILE__ ) . 'dist/css/editor.css' )
);
wp_register_style(
'wild-wonders-hero-style',
plugins_url( 'dist/css/blockStyle.css', __FILE__ ),
array(),
filemtime( plugin_dir_path( __FILE__ ) . 'dist/css/blockStyle.css' )
);
register_block_type( 'blocks/wild-wonders-blocks-hero', array(
'editor_script' => 'wild-wonders-blocks-hero',
'editor_style' => 'wild-wonders-editor-style',
'style' => 'wild-wonders-hero-style',
) );
} add_action('init', 'wild_wonders_blocks');
就我所阅读的几个教程而言,这是添加样式表的正确方法。但是,我在前端一无所获。甚至没有网络请求....还有什么我应该做的吗?谢谢
【问题讨论】:
标签: wordpress-gutenberg gutenberg-blocks