Hello,
I am a WordPress-Neewbie, so I hope you are able to understand my question. I try my best to explain my problem 😉
I want to create custom fields with ACF using a repeater: Image and text. I want to decide in the backend of WP if the image is on the left side or on the right sight. Can I load a special php-file that styles it? How can I do it?
Thank you very much!
Not sure I completely understand what you’re looking for. Do you want to place the image on the left or right in the admin when someone is entering them or on the front end when they’re displayed on the site?
theoretical it could both (front and back-end) could be solved by adding a radio button before the image & textfield with left and right. and then add a logical condition based on this field. add twice the text and image field with same names, once ordered image first once text first.
- radio button: with values left and right
- imagefield with condition left
- textfield with condition left
- textfield with condition right
- imagefield with condition right
at php use value of radio button to show image at left or right
$my_image_position = get_sub_field('my_image_position');
if($my_image_position == "left"){the_sub_field('my_image'); the_sub_field('my_text');}
if($my_image_position == "right"){the_sub_field('my_text'); the_sub_field('my_image');}