<h2>This page is a gallery.</h2> <p>Of nice animal pictures, nonetheless!</p> <div class="gallery"> <?php printImages('animals'); ?> <?php the_title(); // auto echo ?> <?php $title = get_the_title(); // return a value ?> </div>
'client_secret' => clientSecret, 'grant_type' => 'authorization_code', 'redirect_uri' => redirectURI, 'code' => $code ); $curl = curl_init($url); //we need to transfer some data curl_setopt($curl,CURLOPT_POST,true); //using POST curl_setopt($curl,CURLOPT_POSTFIELDS,$access_token_settings); //use these settings curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); //return results as string curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); //don't need to verify any certificates $result = curl_exec($curl); //go get the data! curl_close($curl); //close connection to free up your resources $results = json_decode($result,true); $userName = $results['user']['username']; printImages($results['user']['id'],$results['access_token']); }else{ ?> <!doctype html> <html lang="en"> <body> <!-- When they click this, they will be prompted to Login to Instagram --> <a href="https://api.instagram.com/oauth/authorize/?client_id=<?php echo clientID; ?>&redirect_uri=<?php echo redirectURI; ?>&response_type=code">Login</a> </body> </html> <?php } ?>