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');
?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.