I am trying to access selected post information from my WordPress database to display on a second website which is not a WordPress site nor is it php, it is in fact an asp.net website that i want to display the information on.
I have a WordPress blog at blog.domain.com and another website at domain.com both running on different servers and I need to display the excerpt, title with link on my asp.net website for selected posts. I can easily grab the excerpt and title from the blog's database but the only problem is that the permalink is not in the database.
I had the idea that maybe if I place a short piece of code on every blog to insert the permalink to a new table, i could then grab that to use over on the other website. But that didnt work, perhaps I am not doing it right. This is the code I used and I placed this within the loop on the template file for the page I was testing on.
<?php global $wpdb; $table_name = $wpdb->prefix . "posts_pages_url"; $wpdb->insert($table_name , array('post_id' => get_the_ID(), 'url' => get_permalink())); ?>
I would be very grateful if anyone had any suggestions on how I can access the permalink via a database call.