WordPress 3.0推出时,很多人都不知道如何在WordPress 3.0菜单添加主页链接。简单的解决方案是将主页链接添加菜单自定义链接。在本文中,我们将向您展示如何在WordPress 3.0菜单系统中的页面部件下显示主页链接。这是所有主题开发人员在其WordPress 3.0兼容主题中应具有的内容。

首先打开主题的functions.php文件并粘贴以下代码

function home_page_menu_args($ args){%%% %%
$ args [“show_home”] = true;
return $ args;
}
add_filter(“wp_page_menu_args”,“home_page_menu_args”); %%% %%粘贴代码后,它应在菜单管理页面的“页面”小部件添加“主页”作为选项,以便用户只需检查它home_page_menu_args\” );
Once you have pasted this code, It should add “Home” as an option under the “Pages” widget on the Menu management page so the user can simply check itoff as an item to add to their custom menu.

粘贴代码后,它应在菜单管理页面的“页面”小部件下添加“主页”作为选项,以便用户可以将其作为要添加到其自定义菜单的项目进行检查。

评论被关闭。