Okay, I'm starting out with some AJAX stuff in a wordpress theme

1) I'm building a child theme OFF the thematic framework
2) My child theme has a header.php, index.php, functions.php and style.css (at this stage)

In my header.php I have the following (btw: the code is adapted from http://codex.wordpress.org/AJAX_in_Plugins):

&lt;?php
    if( !is_admin() ) {
 add_action('wp_ajax_my_special_action', 'my_action_callback');
 add_action('wp_ajax_nopriv_my_special_action', 'my_action_callback');
 $_ajax = admin_url('admin-ajax.php');    
}
?&gt;
&lt;script type="text/javascript" &gt;
jQuery(document).ready(function($) {

 var data = {
  action: 'my_special_action',
  whatever: 1234
 };

 jQuery.post('&lt;?php echo($_ajax); ?&gt;', data, function(response) {
  jQuery('#output').html('Got this from the server: ' + response);
 });

});
&lt;/script&gt;
&lt;/head&gt;


Right so that's all cool - and it updates the OUTPUT div on the page with "Got this from the server: 0"

I need a PHP function called "my_action_callback" - so in my theme's functions.php I have the following:

function my_action_callback() {

 $whatever = $_POST['whatever'];

 $whatever += 10;

    echo 'whatever now equals: ' . $whatever;

 die();
}


This is the ONLY function in my functions.php

To make sure the PHP function is working I stick my_action_callback() into my index.php - and it outputs "whatever now equals: 10" as expected.

HOWEVER - the AJAX response is always 'Got this from the server: 0'
Ajax never seems to get the response from the PHP function. 

I tried adding .ajaxError() to see if there were any errors - nope.

I tried adding the PHP functions to another plugin of mine - nope.

What am I missing that jQuery isn't doing the ajax bit for me?

Thanks in advance


Question: What are the symmetries of a principal homogeneous bundle?
Answer: Did you have a look at parabolic geometries.
Your description reminds me of the flat models of parabolic geometries.

MR1352565 (96k:16039). Andreas Cap, Jan Slovak:
Parabolic Geometries I: Background and General Theory.
Mathematical Surveys and Monographs 154, Amer. Math. Soc. 2009, 628 pp.

Here $H$ is assumed to be a parabolic subgroup of a semisimple or reductive group $G$;
you can do an astonishing amount of things with this. 

A little more general, look at Cartan connections.