• I am using the ultimate cms and created a custom taxonomy “labels”. Superb plugin πŸ™‚

    I’ve encountered a problem retrieving custom fields values for tags on the archive pages. Somehow values from different tags are shown on the page. Let me illustrate what happens.

    So far so good:
    1. I have created the taxonomy labels, which has the custom field ‘label_logo’
    2. When I visit the archive for a specific label (i.e. alpha ) the label is shown using the following code <?php echo do_shortcode(‘[xy_labels field=”label_logo”]’); ?>
    3. If I visit an archive for a custom tag with no label_logo nothing is returned, which is correct

    When it goes wrong ( results with multiple labels ):
    1. I visit the category page for label ‘beta’ which has no value for the custom field label logo
    2. The posts on the archive are attached to multiple labels ( alpha and beta )
    3. Now the code serves up the image for alpha although I am on the beta archive

    Is their a manner in which I can restrict the code to get only the results from a specific tag value. Could I use the tag id to restrict the short code?

    Any help would be greatly appreciated.

    Thanks, G

    http://wordpress.org/extend/plugins/ultimate-cms/

Viewing 1 replies (of 1 total)
  • Thread Starter Goose_NL

    (@goose_nl)

    in the mean time I figured out that the shortcode returns all values for that specific field…

    For instance if the value in alpha for label_logo is 123.jpg and in beta it’s 456.jpg. Then archive pages with posts containing both alpha and beta will return 123.jp456.jpg as a result for the shortcode.

    I’ve been trying to following code in order to restrict it to the term id, but it doesn’t work an results in a broken page

    $meta = get_term_meta($term->term_id, ‘label_logo’, true);

Viewing 1 replies (of 1 total)
  • The topic ‘custom field on archive displays value from other tag’ is closed to new replies.