Ok quite a complex thing I'm trying to do here, and I'm a bit unsure how I will do it with wordpress, but I'm hoping some genius out there can help.
I'm basically creating some comparison functionality, and I currently have two select boxes on the page. These select boxes will display the list of all posts within the custom post-type 'countries' inside them, and when the user selects one of the options from the list, I will use ajax to display the content of that particular post below.
I currently have a non-wordpress version of what I am trying to do, and here's the code.
HTML
<select id="compare-one">
<option value="United Kingdom">United Kingdom</option>
<option value="Belarus">Belarus</option>
<option value="Albania">Albania</option>
Jquery
$('#compare-one').change(function(e){
$('#compare-one-container').empty();
$(this).find(':selected').each(function(i,e){
$.get("callbacks.php",
// used to prevent caching in IE
{ nbRandom: Math.random() },
function(data){
$("#compare-one-container").html(data);
});
});
});
callbacks.php
<?php $test = "Home" ?>
So as you can see, I have no implemented this into Wordpress just yet - simply because I'm unsure of the right way to do so!
I think my main question is how to replace this current php code with something that checks to see if the current selected value is equal to the page title, and if so echo the information (content, custom fields etc) from that particular page title it matches.
Any help on this would be greatly appreciated!
Thanks