Ajax and wordpress
Out of context: Reply #10
- Started
- Last post
- 16 Responses
- Ravdyk0
Ok I am starting to feel really stupid for not getting this.
This is my link:
<div class="more"><a href="<?php the_permalink(); ?>" post_id="<?php the_ID(); ?>">More</a></div>This is ajax script:
<script type="text/javascript">
$(document).ready(function(){
$.ajaxSetup({cache:false});
$(".more").click(function(){
var post_id = $(this).attr("rel")
$("#single-post").html("loading...
$("#single-post").load("<? bloginfo('template_url');?>/ajax-handler.php",{p:post_id});
return false;
});
});
</script>And I used your code for the file. Somehow it only shows the loading part and doesn't do anything. And while your reading this your probably going "like duh" but I got no clue. Not even a bit of a clue. Can you advice me on stuff to read or anything like that?