Advanced Custom Fields
[resolved] Repeat fields Two columns (3 posts)

  1. ufita
    Posted 4 years ago #

    I am using repeat field. I want to show an image in the left and text in the right, the same how look this example.


    The preview of the website all the images are align on the top and don't with the block of text.

    What is the right code for this?

    I tried with div but doesn't work


    // or the_repeater_field + the_sub_field
    if(get_field('services')): ?>
    <?php while(the_repeater_field('services') ): ?>

    <div id="services">
    <img src="<?php the_sub_field('services_images'); ?>" class="image-left" />
    <div id="services-right"><?php the_sub_field('services_content'); ?></div>

    <?php endwhile; ?>

    <?php endif; ?>


  2. elliotcondon
    Plugin Author

    Posted 4 years ago #

    This is all up to the CSS, your PHP code is fine, just edit your CSS to float the image to the left, etc

  3. ufita
    Posted 4 years ago #

    Hi Elliot, Thank you so much. I did it with css and before your answer my question and working fine, just I thought that maybe exist another way. :-)

    Thank u again, sweet.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Advanced Custom Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic