How do you extract the url from :
$url = get_the_term_list($post->ID, 'nom-origin')
I have tried many things but i just don’t get it. The only solution i got was this but i know it’s just too messy :
$url = get_the_term_list($post->ID, 'nom-origin');//,'<h3>Job Category:</h3> ', ', ', '' );
$url_tmp1 = explode("href="",$url);
$url_tmp2 = explode("" rel="tag">",$url_tmp1[1]);
$url_simple = $url_tmp2[0];
get_term_link
gives you the link of a particular taxonomy term.Never try to parse complete markup when you don’t have to. Follow the function calls.
get_the_term_list
usesget_the_terms
get_the_terms
returns an array of termsget_term_link
to get your URLsAnd the code for that is in the Codex.
You may want to build an array instead, but its the same idea: