Support

Account

Home Forums ACF PRO Display json along with acf. Reply To: Display json along with acf.

  • My question is: How could I manipulate the information. Ex:
    If the biography does not exist, how could I type it manually? I wanted to save this data received within acf. I can display all the information perfectly. However, I can not manipulate and edit the data I received. Can you point the way?

       <?php
    
    //field is ID
    
    $url = 'https://api.themoviedb.org/3/person/'.get_field('api').'?api_key=f16d933a3e68465c1ef9a4a82b41a2d5&language=pt-BR';
    
    $contents = file_get_contents($url);
    $person=json_decode($contents);
    
    $personname = $person->name; 
    $biography = $person->biography;
    $profile_path=$person->profile_path;
    
    echo $personname . "<br>";
    echo "<img src='https://image.tmdb.org/t/p/w600_and_h900_bestv2/" . $profile_path ."'/ >";
    echo $biography = the_field('biography');
    
    ?>