On page through query_post the tape of posts is constructed - one headings are displayed. The popup is bolted to the headlines, and here you need to load the content of this post by clicking on the AJAX. The ajax request itself wrote it seems correct, the handler also works. But! How correctly from a cycle to transfer to the request the id of the post that was clicked? Now I write it to a variable, then this variable goes to a request in php, but the problem is that the variable is in a loop ... And accordingly, at the time of the click in it, the id of the last record of the loop is always ... That's what to do, ?