API call
-
Hello,
I am trying to make simple API call on my WordPress site using the following instructions here (http://www.tourcms.com/support/api/mp/code/library_php.php)
This is so I can retrieve tour information back into my webiste. I’ve got to the point where the test.php is working but I’m struggling to get the code working. I added thhe code below to my functions.php which returned an empty page ….?Please help
add_action('inside_top_theloop', 'tourcms_custom_content'); function tourcms_custom_content(){ if (is_singular( 'holiday' ) ) { include 'http://mywebsite.com/tourcms.php'; include 'http://mywebsite.com/config.php'; $tourcms = new TourCMS($marketplace_account_id, $api_private_key, "simplexml"); ?><div>This is some data using API</div> <?php $result = $tourcms->api_rate_limit_status($channel_id); print 'Remaining hits: '.$result->remaining_hits;?> <?php } }
The topic ‘API call’ is closed to new replies.