Genesis框架由于seo原因和内置的挂钩/过滤器非常好,所以我理解您为什么要使用它。我通过多种方式合并了bulma。首先,我使用了sass,其中类之间可以进行一对一的匹配。i、 e类.wrap{ @extends .container; }
. 另一种解决方案是在html中添加自定义类。我保留了默认的类,以防我决定摆脱bulma。您可以在此处阅读更多信息:https://alexanderdejong.com/genesis/changing-adding-custom-classes-html-5/
我还重新构建了标题,因为genesis菜单/标题结构很糟糕。您可以创建新标题。phphttps://github.com/teamscops/bulmapress/blob/master/header.php 或者使用内置挂钩。
remove_action( \'genesis_header\', \'genesis_header_markup_open\', 5 );
remove_action( \'genesis_header\', \'genesis_header_markup_close\', 15 );
remove_action( \'genesis_header\', \'genesis_do_header\' );
//add in the new header markup - prefix the function name - here sm_ is used
add_action( \'genesis_header\', \'sm_genesis_header_markup_open\', 5 );
add_action( \'genesis_header\', \'sm_genesis_header_markup_close\', 15 );
remove_action(\'genesis_after_header\', \'genesis_do_nav\');
remove_action( \'genesis_site_title\', \'genesis_seo_site_title\' );
//New Header functions
function sm_genesis_header_markup_open() {
genesis_markup( array(
\'html5\' => \'<header %s>\',
\'context\' => \'site-header\',
) );
// Added in content
do_action( \'genesis_site_title\' );
echo \'<div class="navbar"><div class="container">\' . get_logo() . \'<div class="navbar-menu">\' .
wp_nav_menu(array(
\'menu_class\' => \'main-menu\',
\'container_class\' => \'navbar-start\',
\'echo\' =>false
))
. \'</div></div></div>\';
genesis_structural_wrap( \'header\' );
}
function sm_genesis_header_markup_close() {
genesis_structural_wrap( \'header\', \'close\' );
genesis_markup( array(
\'close\' => \'</header>\',
\'context\' => \'site-header\',
) );
}
function get_logo() {
return \'<div class="navbar-brand"><a class="navbar-item" href="\' . get_site_url() . \'"><img class="logo" src="\' . get_stylesheet_directory_URI(). \'/images/logo.png" alt="logo"></a></div>\';
}