xlanguage with custom fields
-
Hello!
Please help me with this xlanguage/custom fields problem!
Im using custom fields to output a list of partners for a site and i cant seem to get xlanguage to work on the array of custom fields.
this is the code i use to output the custom fields:
<div id=”partners”>
<?php
$partners[‘partners’] = get_post_meta($post->ID,’partner’,false);
$partners[‘link’] = get_post_meta($post->ID,’partner_link’,false);
$partners[‘logo’] = get_post_meta($post->ID,’partner_logo’,false);
$partners[‘description’] = get_post_meta($post->ID,’partner_description’,false);
$ref =& $partners[‘partners’];
$i=”0″;
foreach ($ref as $value) {
echo “<div class=’partners_rubrik’><h3>$value</h3>
<img alt='”.$partners[‘logo’][$i].”‘ src=’https://www.laplandevent.com/img/wp/partners/”.$partners[‘logo’][$i].”‘>”.$partners[‘description’][$i].”</div>”;
$i++;
}
?></div>`
the code works and out puts all the custom fields but unfortunately xlanguage does not understand the language tags<span lang="xx"></span>
so it outputs both languages (xlanguage works perfectly on all other patrs of the site).
i found a sollution to custom fields using:`
$partners = apply_filters(‘the_title’,get_post_meta($post->ID,$partner,true));`
However this only works with single values and not array.Please help!!!
I cant find anything of use on this topic anywhere.
- The topic ‘xlanguage with custom fields’ is closed to new replies.