我假设您使用的是211主题,或者其他支持子主题的主题。如果您使用的是自定义主题,那么只需编辑现有函数即可。php并在那里添加附加功能,然后编辑现有样式。css。但是,如果您的情况不同,请发回,我会更新以处理您使用的任何主题。
截至2012年12月,该网站的页脚就是一个例子:http://dev.artbeforehygiene.com/
在您的/wp-content/themes/called目录中创建子主题twenteleven-child (或者不管你想叫它什么,为了这些步骤,我将使用这个名称)
创建两个文件:函数。php和一种风格。该目录中的css风格独特。css,添加以下代码:/*
Theme Name: Twentyeleven Child: Triple Footer Addition
Description: Child theme for the twentyeleven theme with footers
that look like http://www.microsoft.com/en-gb/default.aspx
Author: [Your Name Here], Will Lanni
Template: twentyeleven
*/
@import url("../twentyeleven/style.css");
/* Style Twentyeleven Footer to resemble Microsoft site */
#colophon {
background: #eee;
}
#site-generator,
#supplementary {
background: transparent;
}
#supplementary h3 {
font-family: "wf_SegoeUI","Tahoma","Verdana","Arial","sans-serif";
font-size: 1.2em;
font-weight: normal;
line-height: 1.25em;
margin-bottom: 0.65em;
color: #1a1a1a;
text-transform: none;
}
#supplementary ul.menu {
list-style-type: none;
margin: 0 0 1.5em;
padding: 0.25em 0 0.5em;
}
#supplementary ul.menu li {
padding-bottom: .7em;
font-size: .9em;
}
#supplementary ul.menu li a {
font-weight: normal;
color: #1570A6;
transition: color 0.1s linear 0s;
}
#supplementary ul.menu li a:hover {
color: #083947;
}
函数中的。php,添加以下代码(这将创建一组额外的导航菜单,您可以在WP Dashboard>Appearance>menus中控制这些菜单)。Twentyeleven已经提供了三个页脚小部件区域。但是,如果您的主题只有一个,您可以通过取消注释下面的添加页脚代码来添加其他页脚区域。<?php
// register additional custom menu slots
function childtheme_register_menus() {
if ( function_exists( \'register_nav_menu\' )) {
register_nav_menu( \'footer-1st-menu\', \'1st Additional Footer Menu\' );
register_nav_menu( \'footer-2nd-menu\', \'2nd Additional Footer Menu\' );
register_nav_menu( \'footer-3rd-menu\', \'3rd Additional Footer Menu\' );
register_nav_menu( \'footer-4th-menu\', \'4th Additional Footer Menu\' );
register_nav_menu( \'footer-5th-menu\', \'5th Additional Footer Menu\' );
}
}
add_action(\'init\', \'childtheme_register_menus\');
/*
Create additional footer areas ONLY IF THEY DON\'T EXIST!!!
Just uncomment out the add_action... but...
If you\'re using twentyeleven, these are already there, just leave this alone!
*/
//add_action( \'widgets_init\', \'childtheme_widgets_init\' );
function childtheme_widgets_init() {
register_sidebar( array(
\'name\' => __( \'Footer Area One\', \'twentyeleven\' ),
\'id\' => \'sidebar-3\',
\'description\' => __( \'An optional widget area for your site footer\', \'twentyeleven\' ),
\'before_widget\' => \'<aside id="%1$s" class="widget %2$s">\',
\'after_widget\' => "</aside>",
\'before_title\' => \'<h3 class="widget-title">\',
\'after_title\' => \'</h3>\',
) );
register_sidebar( array(
\'name\' => __( \'Footer Area Two\', \'twentyeleven\' ),
\'id\' => \'sidebar-4\',
\'description\' => __( \'An optional widget area for your site footer\', \'twentyeleven\' ),
\'before_widget\' => \'<aside id="%1$s" class="widget %2$s">\',
\'after_widget\' => "</aside>",
\'before_title\' => \'<h3 class="widget-title">\',
\'after_title\' => \'</h3>\',
) );
register_sidebar( array(
\'name\' => __( \'Footer Area Three\', \'twentyeleven\' ),
\'id\' => \'sidebar-5\',
\'description\' => __( \'An optional widget area for your site footer\', \'twentyeleven\' ),
\'before_widget\' => \'<aside id="%1$s" class="widget %2$s">\',
\'after_widget\' => "</aside>",
\'before_title\' => \'<h3 class="widget-title">\',
\'after_title\' => \'</h3>\',
) );
}
?>
在外观>菜单中创建页脚菜单。您将在页脚中为每个子菜单创建一个菜单。确保保存!将这些菜单中的一个添加到左侧的一个下拉窗口中。保存转到外观>小部件将自定义菜单小部件拖动到一个页脚插槽中,适当命名,然后选择要显示的导航菜单对要添加的其他菜单重复上述操作保存并查看您的网站