<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:wfw="http://wellformedweb.org/CommentAPI/">
<channel>
<title>拾星漫记 - Bearsimple</title>
<link>https://blog.zhifouli.top/index.php/tag/Bearsimple/</link>
<atom:link href="https://blog.zhifouli.top/index.php/feed/tag/Bearsimple/" rel="self" type="application/rss+xml" />
<language>zh-CN</language>
<description></description>
<lastBuildDate>Fri, 25 Jul 2025 12:39:00 +0800</lastBuildDate>
<pubDate>Fri, 25 Jul 2025 12:39:00 +0800</pubDate>
<item>
<title>Bearsimple主题短代码使用指南</title>
<link>https://blog.zhifouli.top/index.php/archives/35/</link>
<guid>https://blog.zhifouli.top/index.php/archives/35/</guid>
<pubDate>Fri, 25 Jul 2025 12:39:00 +0800</pubDate>
<dc:creator>知否离</dc:creator>
<description><![CDATA[本文介绍了Bearsimple主题支持的31种短代码及其使用示例，涵盖内容隐藏、代码高亮、字体颜色、音频视频插入等功能，方便用户快速构建博客内容。]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
文章包含隐藏内容，请进入文章内页查看~
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://blog.zhifouli.top/index.php/archives/35/#comments</comments>
<wfw:commentRss>https://blog.zhifouli.top/index.php/feed/tag/Bearsimple/</wfw:commentRss>
</item>
<item>
<title>Bearsimple V2侧边栏分类统计计数异常修复</title>
<link>https://blog.zhifouli.top/index.php/archives/27/</link>
<guid>https://blog.zhifouli.top/index.php/archives/27/</guid>
<pubDate>Fri, 25 Jul 2025 10:42:00 +0800</pubDate>
<dc:creator>知否离</dc:creator>
<description><![CDATA[Bearsimple V2主题修复了侧边栏分类计数异常问题，通过添加代码正确计算一级分类及其子分类的文章总数，使显示结果更准确。]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<div class="aisummary"><p class="ai-header"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"         stroke-width="2" stroke-linecap="round" stroke-linejoin="round">         <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>         <path d="M3 10a4 4 0 0 1 4 -4h10a4 4 0 0 1 4 4v6a4 4 0 0 1 -4 4h-10a4 4 0 0 1 -4 -4v-6z"></path>         <path d="M8 3l2 3"></path>         <path d="M16 3l-2 3"></path>         <path d="M9 13v-2"></path>         <path d="M15 11v2"></path>     </svg>AI摘要 </p> <div class="ai-text-container">     <div class="ai-hidden-text">Bearsimple V2主题修复了侧边栏分类计数异常问题，通过添加代码正确计算一级分类及其子分类的文章总数，使显示结果更准确。</div>     <div class="ai-typewriter-text"></div> <span class="ai-cursor"></span> </div> <p class="ai-footer"> 此内容根据文章生成，仅用于文章内容的解释与总结 </p></div><p><a href="https://github.com/whitebearcode/typecho-bearsimple/">Typecho主题 - Bearsimple V2</a></p><p>侧边栏的根分类计数为0，没有正确计算和现实分类树的权值总和<br><img src="https://upyuncdn.zhifouli.top/weblog/uploads/2025/07/4157002980.png" alt="" title=""></p><p>在sidebar.php加上统计的逻辑代码</p><pre><code class="lang-php">&lt;?php 
// 修复一级分类文章数显示问题：计算一级分类及其子分类的文章总数
// 原始代码只显示一级分类本身的文章数，不包括子分类的文章数
$totalCount = $categorys-&gt;count; // 一级分类本身的文章数
if (!empty($children)) {
    // 遍历所有子分类，累加它们的文章数
    foreach ($children as $mid) {
        $child = $categorys-&gt;getCategory($mid);
        $totalCount += $child[&#039;count&#039;]; // 累加子分类文章数
    }
}
?&gt;
&lt;?php if (empty($children)) { ?&gt;
    &lt;li&gt;
      &lt;div class=&quot;tree-node&quot;&gt;
        &lt;a href=&quot;&lt;?php $categorys-&gt;permalink(); ?&gt;&quot; class=&quot;category-link&quot;&gt;&lt;?php $categorys-&gt;name(); ?&gt; &lt;span class=&quot;category-count&quot;&gt;(&lt;?php echo $categorys-&gt;count(); ?&gt;)&lt;/span&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/li&gt;
   &lt;?php } else { ?&gt;
  &lt;li&gt;
      &lt;div class=&quot;tree-node&quot;&gt;
        &lt;span class=&quot;toggle-icon&quot;&gt;&lt;/span&gt;
        &lt;!-- 对于有子分类的一级分类，显示包含子分类文章数的总计数 --&gt;
        &lt;a href=&quot;&lt;?php $categorys-&gt;permalink(); ?&gt;&quot; class=&quot;category-link&quot;&gt;&lt;?php $categorys-&gt;name(); ?&gt; &lt;span class=&quot;category-count&quot;&gt;(&lt;?php echo $totalCount; ?&gt;)&lt;/span&gt;&lt;/a&gt;
      &lt;/div&gt;
      &lt;ul class=&quot;tree-view&quot;&gt;
          &lt;?php foreach ($children as $mid) { ?&gt;</code></pre><p>成功显示<br><img src="https://upyuncdn.zhifouli.top/weblog/uploads/2025/07/1999609988.png" alt="" title=""></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://blog.zhifouli.top/index.php/archives/27/#comments</comments>
<wfw:commentRss>https://blog.zhifouli.top/index.php/feed/tag/Bearsimple/</wfw:commentRss>
</item>
</channel>
</rss>