文章标签 ‘同时显示页面和分类’
好久没有折腾Wordpress了,晚上趁着睡不着,更换下主题并做些修改,为了以后方便修改和查找,在此记录下。 第一、修改inove导航菜单同时显示页面和分类 1、给主题设置里添加一个选项:show all(意思就是同时显示页面和分类)。 1)修改inove/functions.php在第220行找到: <label> <input name="menu_type" type=”radio” value=”categories” <?phpif($options['menu_type'] == ‘categories’) echo "checked=’checked’"; ?> /> <?php _e(‘Show categories as menu.’, ‘inove’); ?> </label> 2)在下面添加: <label> <input name="menu_type" type=”radio” value=”pages_and_categories” <?phpif($options['menu_type'] == ‘pages_and_categories’) echo"checked=’checked’"; ?> /> <?php _e(‘Show All.’, ‘inove’); ?> </label> 2、实现ShowAll功能: 1)修改inove/templates/header.php在第30行找到: <?php if($options['menu_type'] == ‘categories’){wp_list_categories(‘title_li=0&orderby=name&show_count=0′);} else {wp_list_pages(‘title_li=0&sort_column=menu_order’);} ?> 2)将上面的代码替换为: <?php [...]
