Support

Account

Forum Replies Created

  • Thanks @kartofelek007 for that.

    I noticed it didn’t affect repeaters with layout set to table, so I added these two lines of css:

    .acf-input-table.table-layout .acf-row:nth-of-type(2n) td {
    	background: #eeeeee;
    }
    .acf-input-table.table-layout .acf-row:nth-of-type(2n) td.order, .acf-input-table.table-layout .acf-row:nth-of-type(2n) td.remove {
    	background: #e3e3e3;
    }
  • you could make a repeater with minimum rows set to 1 and maximum rows also set to 1?

  • Hi @Elliot Condon,

    Thanks so much for the help. Your solution worked, though I had to change my whole loop because I was no longer able to access fields by their field names, instead I had to use the database name thingies that look like this: ‘field_5445285988c8b’ and I needed different code for the image since the returned value for that was changed, and I had to add a new field for the title as I couldn’t figure out how to get the title attribute from the image in WordPress. Not sure how complicated things would get with other kinds of fields, but for now it’s working great with those minor changes.

    If you were wondering, the reason for all this is so the user can see an immediate preview of their youtube video in the backend, and it’s easier for them to paste an entire YouTube link rather than getting the 11-character video ID from the URL, which is how I’ve done it in the past.

  • I can’t seem to make this work with my repeater. Here’s my code:

    if(have_rows('videos')): while(have_rows('videos')): the_row();
        $video_embed_url = get_sub_field('video_embed', false, false);
        $thumbnail = get_sub_field('thumbnail');
        $thumbnail_url = $thumbnail['url'];
        echo '<a href="' . $video_embed_url . '"><img src="' . $thumbnail_url . '" /></a>';
    endwhile; endif;

    It’s outputting the whole iframe embed code, not the URL entered into the oEmbed field. Also, nothing changes if I remove ‘false, false’ from that get_sub_field.

  • argh sorry I meant to add that I want to be able to have 0 rows, so that solution won’t work.

Viewing 5 posts - 1 through 5 (of 5 total)