Support

Account

Home Forums Backend Issues (wp-admin) Display repeater in a php as css Reply To: Display repeater in a php as css

  • So I have some difficulties with ajax. With a developper friend, we did like this and it’s working.

    So if someone have the same problem, we did it like this:

    I made a php file “parametres-template-css.php” wich calling acf fields and use:

    <?php
    if( have_rows('repeater', 'option') ):					
    	while( have_rows('repeater', 'option')): the_row(); 
    		$FieldColor = get_sub_field('color'); 			
    	endwhile; 
    endif; 

    the first problem was I used the_sub_field and not get_subfield

    I made my css-php “styles-css.php” file including “parametres-template-css.php” like this:

    <?php require( 'parametres-template-css.php'); ?>
    
    <?php /* ---------------- TITLE ----------------  */ ?>
    
    	h1{ color:  <?php echo $h1titleColor ; ?>;}

    and I included this file in my headers

    <style><?php include("inc/template/css-template/styles-css.php"); ?></style>