Fetching taxonomy as text

☆樱花仙子☆ 提交于 2019-12-11 23:17:42

问题


I want to fetch taxonomy item(s) in my meta description tag but it add some hyperlink code in it.

I am using this code for that

<?php echo get_the_term_list( $post->ID, 'writer', '', ', ' ); ?>

as

<meta name="description" content="These are the famous writers <?php echo get_the_term_list( $post->ID, 'writer', '', ', ' ); ?>. "/>

and the result that I want it this.

<meta name="description" content="These are the famous writers one, two, three" />

but I am getting this instead.

<meta name="description" content="These are the famous writers <a href="http://www.example.com/one">one</a>, <a href="http://www.example.com/two">two</a>, <a href="http://www.example.com/three">three</a>" />

So what can I do to get them without the hyperlink.

来源:https://stackoverflow.com/questions/25641584/fetching-taxonomy-as-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!