Wordpress Events Manager:个性化单一类别页面丢失了“current-page-item”CSS类

时间:2014-01-08 00:24:25

标签: wordpress wordpress-plugin current-page

我有一类事件(A),它有2个子类别(A1,A2)。我需要列出按子类别分组的所有事件:

Category A 

 Category A1
 Some description text
 Coming events : blabla (these events are sorted by the location)
-------------------------------------------------------------------
 Category A2
 Some description text
 Coming events : blabla

默认的单一类别页面不显示其子类别的事件,因此我修改了文件模板/ templates / category-single.php:

global $EM_Category;
$arrChild = get_term_children($EM_Category->id, EM_TAXONOMY_CATEGORY); 
$child_count = count($arrChild);

if($child_count == 0) 
    echo $EM_Category->output_single();
else {
    for($i=0; $i < $child_count; $i++){
        $cat = new EM_Category($arrChild[$i]);
        echo '<h2>'.$cat->name.'</h2>';
        echo $cat->output_single(); 
        if($i < $child_count-1)
            echo '<hr/>';   
    }
}

它按照我的预期显示了事件。

当我将此页面添加到导航菜单中时,我发现它丢失了一个CSS类“current-menu-item”,这有助于我突出显示菜单中的当前项目。

也许我做错了什么或者我应该在某处添加/修改某些内容。我完全无能为力。我对PHP5不太熟悉,而且我是Wordpress的新手。

欢迎任何帮助/建议!提前谢谢。

0 个答案:

没有答案