Support Forum ยป User Profile

Forum Replies Created

Viewing 8 posts - 31 through 38 (of 38 total)
  • Author
    Posts
  • JoeJoe
    Participant

    Hi,

    just found out how it works, if you have a better solution, please let me know :

    <?php
    //$terms = get_the_terms($post->ID, array('label', 'week', 'formate', 'pack'),
    $terms = get_the_terms($post->ID, array('label'),
    					   array(
                            'hide_empty'    => true,
    					    'posts_per_page'   => null
                        )
                );
    		  
    foreach($terms as $term) {
    	
    	$image_id = get_term_meta($term->term_id, 'label_image_upload', true);
    	$image_url = wp_get_attachment_image_src($image_id, 'full');
    ?>
    	<img src="<?php echo $image_url[0]; ?>" width="<?php echo $image_url[1]; ?>" height="<?php echo $image_url[2]; ?>" />
    <?php
    }
    ?>
    JoeJoe
    Participant

    So far I have accomplished this

    <?php
    //Getting the term by name
    $terms = get_the_terms($post->ID, 'label'); 
    		  
    		  print_r ( $terms );
    
    //Retrieving images from taxonomy by term id
    foreach($terms as $term) {
    	
    	echo $term->term_id;
    ?>

    the print_r($terms) function gives me the following:

    Array ( [0] => WP_Term Object ( [term_id] => 53 [name] => Dog Art [slug] => dog-art [term_group] => 0 [term_taxonomy_id] => 53 [taxonomy] => label [description] => [parent] => 0 [count] => 7 [filter] => raw ) ) 53

    which is great because this is the label, that is attached to the CPT, the term_id is also correct

    now I just need the image ...
    How do I get to the image of the custom field ?

    in reply to: โœ…How to display attachments of CPT in Admin Edit Screen #38480
    JoeJoe
    Participant

    ok, thank you for your time and effort. ๐Ÿ™‚

    in reply to: โœ…How to display attachments of CPT in Admin Edit Screen #38469
    JoeJoe
    Participant

    Hello,
    for all images I have used the Media Library and attached the image to the post, they are all attachments
    thank you

    in reply to: Cloneable Metabox Group with Oxygen Builder #37019
    JoeJoe
    Participant

    Hi,

    had the same problem , try using MB Views works great with no problems

    regards

    in reply to: โœ…Display Checkbox List in Custom Settings Group #36319
    JoeJoe
    Participant

    Excellent, thank you very much

    in reply to: โœ…Display image from Custom Setting Group #36289
    JoeJoe
    Participant

    I am really sorry to bother you again ...

    I also have a checkbox List that has an ID team_member_position

    This does not work :

    <?php $values = rwmb_meta( 'team_member_position' ); ?>
    			
    <ul>
        <?php foreach ( $values as $value ) { ?>
            <li><?php echo $value; ?></li>
        <?php } ?>
    </ul>

    I have checked the docs, and basically none of the solution fits, because this is a list of multiple choices AND cloneable values, can you pls help me one more time.

    in reply to: โœ…Display image from Custom Setting Group #36277
    JoeJoe
    Participant

    Thank you very much, it works, i had the same line of code, i think , duhhh

    cool thanks ๐Ÿ™‚

Viewing 8 posts - 31 through 38 (of 38 total)