2010-10-07 132 views
0

我有两个博客页面:另一个从一个类别获取所有帖子,另一个从所有其他类别获取所有帖子。并且使用3.0中引入的新菜单系统。wordpress中的活动菜单状态

现在的问题是,当用户在让我们可以说在category2的单个帖子页面上,但仍然在菜单中category1具有活动状态类。

在这两个类别上,单个帖子使用相同的模板(默认模板)。

回答

0

好吧,这很容易,在here上有一个不错的帖子,把它放在主题中的function.php文件中。

<?php function insertAds($content) { $content = $content.'<hr /><a href="http://www.wprecipes.com">Have you visited WpRecipes today?</a><hr />'; return $content; } add_filter('the_excerpt_rss', 'insertAds'); add_filter('the_content_rss', 'insertAds'); ?> 
+0

这太神奇了 – Samn 2014-10-14 15:33:19