Drupal: how can I remove the links from taxonomy terms?

家住魔仙堡 提交于 2019-12-01 22:00:02

You never want to edit a core module like taxonomy, as this makes it very complicated to upgrade your Drupal install. See also.

You can use hook_link_alter to alter/remove the links in your own module. Adding them back in as non-links is a little more complicated, but can be done in your node.tpl.php file with example code.

I would suggest Display Suite module or some jQuery

jQuery(".taxonomy-term h2 a").each(function(){
var $t = jQuery(this);
$t.after($t.text());
$t.remove();

Thanks @Will and @Matt for this elegant solution.

Dharmendra saini

try this:

jQuery(".views-field-field-categories >.field-content >a").removeAttr("href");
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!