當前位置:編程學習大全網 - 源碼下載 - typecho修改分類輸出的樣式

typecho修改分類輸出的樣式

修改List文件的listCategories函數,把默認的修改成妳想要的即可。

下面是listCategories函數:

/**

*?treeViewCategories?

*

*?@param?$categoryOptions?輸出選項

*?@access?public

*?@return?void

*/

public?function?listCategories($categoryOptions?=?NULL)

{

//初始化壹些變量

$this->_categoryOptions?=?Typecho_Config::factory($categoryOptions);

$this->_categoryOptions->setDefault(array(

'wrapTag'=>?'ul',

'wrapClass'?=>?'',

'itemTag'=>?'li',

'itemClass'?=>?'',

'showCount'?=>?false,

'showFeed'?=>?false,

'countTemplate'?=>?'(%d)',

'feedTemplate'?=>?'<a?href="%s">RSS</a>'

));

//?插件插件接口

$this->pluginHandle()->trigger($plugged)->listCategories($this->_categoryOptions,?$this);

if?(!$plugged)?{

$this->stack?=?$this->getCategories($this->_top);

if?($this->have())?{?

echo?'<'?.?$this->_categoryOptions->wrapTag?.?(empty($this->_categoryOptions->wrapClass)

''?:?'?class="'?.?$this->_categoryOptions->wrapClass?.?'"')?.?'>';

while?($this->next())?{

$this->treeViewCategoriesCallback();

}

echo?'</'?.?$this->_categoryOptions->wrapTag?.?'>';

}

$this->stack?=?$this->_map;

}

}

其中的:

$this->_categoryOptions->setDefault(array(

'wrapTag'=>?'ul',

'wrapClass'?=>?'',

'itemTag'=>?'li',

'itemClass'?=>?'',

'showCount'?=>?false,

'showFeed'?=>?false,

'countTemplate'?=>?'(%d)',

'feedTemplate'?=>?'<a?href="%s">RSS</a>'

));

就是樣式設置了

  • 上一篇:最高的地位,九五至尊的來源是什麽
  • 下一篇:誰能談談電影《羅拉快跑》的敘述技巧?急用啊!!!!!
  • copyright 2024編程學習大全網