Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi lorenzo_pulpolab,
    this is Agnes from Toolset support team.

    Yes, this is possible and you are on the right track. Just mark your Image field as Repeatable.

    Here you will find a similar topic.

    Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

    Thread Starter lorenzo_pulpolab

    (@lorenzo_pulpolab)

    Hi Agnes,

    that’s definitely solve my problem, thanks.

    Is there any way to create a relative thumbnail when you upload an image with a preset size?

    Best

    Hi lorenzo_pulpolab,
    I don’t know if I understand you correctly. In WP Settings->Media you have ‘Thumbnail size’. Later on you can display your custom post image using ‘thumbnail’ value for size attribute, see:
    https://wp-types.com/documentation/functions/#tf-145214

    This will show the image according to the value set in WP Settings/Media/’Thumbnail size’.

    Thread Starter lorenzo_pulpolab

    (@lorenzo_pulpolab)

    Thanks a lot for your support Agnes

    Thread Starter lorenzo_pulpolab

    (@lorenzo_pulpolab)

    Just a last question if you can…

    Now I have a repeater custom field called ‘images-list’, how can I display it with a loop in php? Usually for single fields i use <?php echo get_post_meta(get_the_id(), ‘wpcf-icon’, TRUE) ?> but in this i need a loop to create single img tags.

    Best

    Hi again,
    Please use Types API:
    https://wp-types.com/documentation/functions/#tf-145214

    To see more details for repeated attributes click on the yellow-orange link titled “More ? Repeater attributes, User attributes, Usage examples”.

    If your problem is solved, please don’t forget to mark it as resolved (also for the other topics you created), ok?

    Thread Starter lorenzo_pulpolab

    (@lorenzo_pulpolab)

    Hi Agnes,

    thanks for your patience.

    I tryed with types_render_usermeta_field( “my-image”, array( “alt” => “blue bird”, “width” => “300”, “height” => “200”, “proportional” => “true”, user_id => “1” ) ) but the problem is I don’t know the user ID, should be maybe Post ID cause images are custom types of a post.

    I cannot understand how can I applicate a loop to display images-repeater.

    BTW I marked as solved the other post ??

    Best

    lorenzo, please try sth like this:

    <?php echo '<ul><li>'.  types_render_field("artist-pitures", array("raw"=>"false","separator"=>"</li><li>")) .'</li></ul>' ; ?>

    Replace the artist-pitures with your custom field slug. You can use other HTML tags of course. Just wanted to show you the idea.

    Thread Starter lorenzo_pulpolab

    (@lorenzo_pulpolab)

    Thanks Agnes,

    this code is returning correctly the images.

    What about if I want to chose the size, defined on control panel, for rendered images?

    For example show thumbnails wrapped with “a” tag to open full size image.

    Thanks for your support

    Hi again,
    in this case it would be more comfortable to iterate through all the pictures in a loop.

    I will show the idea and I think you will know how to adapt it to your needs:

    <?php
    		$all_pictures = get_post_meta($post->ID, 'wpcf-artist-pitures', false);
    		foreach ($all_pictures as $single_picture)
    			echo $single_picture . '<br />';
    		?>

    Don’t forget to add wpcf- prefix before your custom field slug.

    Thread Starter lorenzo_pulpolab

    (@lorenzo_pulpolab)

    Thanks a lot Agnes

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Add an images gallery’ is closed to new replies.