【温馨提示:视频教程将在6月份开始更新,可提前购买,1-10元一节课,联系QQ248758228】
今天在研究wordpress的导航菜单。经过查询资料发现一个wordpress菜单里面包含了以下内容。可以在网站任何页面来调用菜单内容:
{ "ID": 10, //导航的ID "post_author": "1", //添加导航的作者 "post_date": "2017-12-11 16:39:20", //添加的时间 "post_date_gmt": "2017-12-11 08:39:20", //添加的时间GMT,就是时区不一样 "post_content": "是大多数都是", //这里同导航的描述,因为后台菜单没有给出都会内容输入框。 "post_title": "", "post_excerpt": "多少倒萨", "post_status": "publish", "comment_status": "closed", "ping_status": "closed", "post_password": "", "post_name": "10", "to_ping": "", "pinged": "", "post_modified": "2017-12-11 17:24:08", "post_modified_gmt": "2017-12-11 09:24:08", "post_content_filtered": "", "post_parent": 0, "guid": "http://ws2.love.com/?p=10", "menu_order": 3, "post_type": "nav_menu_item", "post_mime_type": "", "comment_count": "0", "filter": "raw", "db_id": 10, "menu_item_parent": "0", "object_id": "2", "object": "page", "type": "post_type", "type_label": "页面", //导航的类型,大概分为 文章、页面、分类、自定义分类等等 "url": "http://ws2.love.com/sample-page/", //导航的链接 "title": "示例页面", //导航的名称 "target": "", //是否新页面打开 "attr_title": "多少倒萨", "description": "是大多数都是", //导航描述 "classes": [ //导航里面有多少CLASS "head_nav_div_li3", "menu-item", "menu-item-type-post_type", "menu-item-object-page" ], "xfn": "ds", "current": false, "current_item_ancestor": false, "current_item_parent": false }
通过这个对象的内容,您可以自由输出内容,美化的你的导航菜单。
1个问题