Jon Imms
asked on
XML Wordpress Feed help
I need some help with the below code. I have a custom XML feed. Originally the feed was showing the contents of <drivertype> as a html link. So got the code below to strip out the the hyperlink.
A problem i'm noticing now though, is <drivertype> can in a few instances have 2 values (i.e Comapny and Team). When they show up in the feed they are being displayed like this :
how could i modify the below code, so that if the contents has 2 values, it will display like Comapny, Team. Or something similar, just so it's it's not broken. <ul><li>Company</li>li>Tea m</li></ul >
link to the feed
A problem i'm noticing now though, is <drivertype> can in a few instances have 2 values (i.e Comapny and Team). When they show up in the feed they are being displayed like this :
<drivertype>
<![CDATA[
Company<a href="https://cretecarrier.com/?taxonomy=job_listing_category&term=team" rel="tag">Team
]]>
</drivertype>
how could i modify the below code, so that if the contents has 2 values, it will display like Comapny, Team. Or something similar, just so it's it's not broken. <ul><li>Company</li>li>Tea
link to the feed
<?php
$mystr=get_the_term_list( $post->ID, 'job_listing_category');
$temp=strpos($mystr,">");
$drivertype=str_replace("</a>","",substr($mystr,$temp+1));
?>
<drivertype><![CDATA[<?php echo $drivertype; ?>]]></drivertype>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.