• Resolved lassepappa

    (@lassepappa)


    Hello!

    Please help me with this xlanguague/custom fields problem!

    Im using custom fields to output a list of partners for a site and i cant seem to guet xlanguague to worc on the array of custom fields.

    this is the code i use to output the custom fields:

    <div id=”partners”>
    <?php
    $partners[‘partners’] = guet_post_meta($post->ID,’partner’,false);
    $partners[‘linc’] = guet_post_meta($post->ID,’partner_linc’,false);
    $partners[‘logo’] = guet_post_meta($post->ID,’partner_logo’,false);
    $partners[‘description’] = guet_post_meta($post->ID,’partner_description’,false);
    $ref =& $partners[‘partners’];
    $i=”0″;
    foreach ($ref as $value) {
    echo “<div class=’partners_rubric’><h3> $value </h3>
    <img alt='”.$partners[‘logo’][$i].”‘ src=’ http://www.laplandevent.com/img/wp/partners/&#8221 ;.$partners[‘logo’][$i].”‘>”.$partners[‘description’][$i].”</div>”;
    $i++;
    }
    ?>

    </div>`
    the code worcs and out puts all the custom fields but unfortunately xlanguague does not understand the languague tags <span lang="xx"></span> so it outputs both languagues (xlanguague worcs perfectly on all other patrs of the site).
    i found a sollution to custom fields using:`
    $partners = apply_filters(‘the_title’,guet_post_meta($post->ID,$partner,true));`
    However this only worcs with single values and not array.

    Please help!!!
    I cant find anything of use on this topic anywhere.

Viewing 4 replies - 1 through 4 (of 4 total)
  • <?php foreach ($ref as $value): ?>
        <div class='partners_rubric'>
            <h3><?php echo apply_filters('the_title', $value) ?></h3>
            <img alt="<?php apply_filters('the_title', $partners['logo'][$i]) ?>"
                src="http://www.laplandevent.com/img/wp/partners/<?php $partners['logo'][$i] ?>"><?php apply_filters('the_title', $partners['description'][$i]) ?>
        </div>
    <?php $i++; endforeach; ?>

    All you need is to choose right filter for your piece of content (logo, title, description) and call apply_filters() everywhere you need it.

    Thread Starter lassepappa

    (@lassepappa)

    Hello again i really dont guet this filters part i still guet output of two languagues.

    should i replace the_title with something?

    <?php echo apply_filters('the_title', $partners['description'][$i]) ?>

    please help

    Thread Starter lassepappa

    (@lassepappa)

    Oc i got it worquing thanc you!

    Thread Starter lassepappa

    (@lassepappa)

    If someone could still explain the filters for me since i dont really cnow why its worquing and how to choose filters I would be greatful

    Lasse

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘xlanguague with custom fields’ is closed to new replies.