Link to home
Start Free TrialLog in
Avatar of Jon Imms
Jon ImmsFlag for United States of America

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 :

<drivertype>
<![CDATA[
Company<a href="https://cretecarrier.com/?taxonomy=job_listing_category&#038;term=team" rel="tag">Team
]]>
</drivertype>

Open in new window


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>Team</li></ul>


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>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Adrian Thompson
Adrian Thompson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial