跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • Typecho导航栏显示独立页面怎么改成显示分类
未分類
2 4 月 2020

Typecho导航栏显示独立页面怎么改成显示分类

gman34 大佬有话说 : 2020-3-31 16:12:16

Typecho导航栏显示独立页面怎么改成显示分类

本帖最后由 gman34 于 2020-3-31 16:32 编辑

显示独立页面怎么改成显示分类:

                        <?php $this->widget(‘Widget_Contents_Page_List’)->to($pages); ?>
                        <?php while ($pages->next()): ?>
                            <li class="nav-item">
                              <a class="nav-link" href="<?php $pages->permalink(); ?>"
                                 title="<?php $pages->title(); ?>"><span><?php $pages->title(); ?></span></a>
                            </li>
                        <?php endwhile; ?>

https://github.com/postbird/typecho-bootstrap-blog

这个开源的主题,有没有改过的?

在去找个还在更新的开源主题吧,这个改来改去太麻烦:L

gman34 大佬有话说 : 2020-3-31 16:17:31

https://github.com/postbird/typecho-bootstrap-blog

这个开源的主题,有没有改过的?

鲁迅 大佬有话说 : 2020-3-31 16:23:56

写成html放进去简单。

木易酱 大佬有话说 : 2020-3-31 16:54:55

就是把page和pages换成category
<?php $this->widget(‘Widget_Metas_Category_List’)->to($category); ?>
<?php while($category->next()): ?>
<li><a<?php if($this->is(‘category’, $category->slug)): ?> class="current"<?php endif; ?> href="<?php $category->permalink(); ?>" title="<?php $category->name(); ?>"><?php $category->name(); ?></a></li>
<?php endwhile; }?>

gman34 大佬有话说 : 2020-3-31 16:57:43

木易酱 大佬有话说 : 2020-3-31 16:54
就是把page和pages换成category

改过很多次了,不是报错就是排版乱了

im286 大佬有话说 : 2020-3-31 17:24:34

还不错啊!!!!我也学习

32MB.CN 大佬有话说 : 2020-3-31 18:07:54

我翻了一下我写的代码
      <li class="menu-item -hasSubmenu"><a href="#"><?php _e(‘分类’);?></a>
            <ul>
                <?php $this->widget(‘Widget_Metas_Category_List’)->to($category);?>
                <?php while ($category->next()): ?>
                  <li><a<?php if ($this->is(‘category’, $category->slug)): ?> class="current"<?php endif;?> href="<?php $category->permalink();?>" title="<?php $category->name();?>"><?php $category->name();?></a></li>
                <?php endwhile;?>
            </ul>
      </li>

gman34 大佬有话说 : 2020-3-31 18:44:18

32MB.CN 大佬有话说 : 2020-3-31 18:07
我翻了一下我写的代码

32MB.CN 大佬有话说 : 2020-3-31 19:10:45

gman34 大佬有话说 : 2020-3-31 18:44

你要根据自己的页面修改啊,我这主题是二级菜单啊

gman34 大佬有话说 : 2020-3-31 20:06:08

32MB.CN 大佬有话说 : 2020-3-31 19:10
你要根据自己的页面修改啊,我这主题是二级菜单啊

不改了,找了个其它主题,太麻烦:L

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具