Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wordpress模板构造 #12

Open
deepthan opened this issue Jan 16, 2018 · 0 comments
Open

wordpress模板构造 #12

deepthan opened this issue Jan 16, 2018 · 0 comments

Comments

@deepthan
Copy link
Owner

模板内容介绍

/*
tips: 此为当前模板信息
Theme Name: owasp
Theme URI: http://www.owasp.com
Description: owasp pages
Version: 1.2
Author: deepthan
Author URI: http://deepthan.com
tags: 简洁,大气,上档次
*/

style.css里面写这些即可模板里面展示

模板图片

名字为 screenshot.png的图片,直接放在与index.php同一级别目录下。

模板修改

  • 怎么增加自定义菜单?

    html在要显示菜单的位置加入这个

 <?php wp_nav_menu( array( 'theme_location' => 'header-menu' )); ?>

functions.php中注册菜单

  if(function_exists('register_nav_menus')){
        register_nav_menus( array(
            'header-menu' => 'home'
        ) );
    }

graph LR
外观-->主题 
主题-->自定义
自定义--> 菜单
菜单-->添加菜单
添加菜单-->显示位置
显示位置-->勾选home,添加项目

  • 自定义菜单怎么修改?
    自定义菜单二级菜单设置为横向的:
    在父标签加一个class类: horizontalMenu
.main-navigation #menu-home li.horizontalMenu > ul.sub-menu{
	max-height: 201px;
	min-width: 606px;
    padding-bottom: 38px;
}

.main-navigation li.horizontalMenu li {
    float: left;
    height: 26px;
    margin: 10px 0;
   	line-height: 46px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant