Ajax and wordpress

Out of context: Reply #11

  • Started
  • Last post
  • 16 Responses
  • acescence0

    a few issues..

    you're grabbing the rel attribute from the link, but your link has no rel attribute..
    <a href="<?php the_permalink(); ?>" rel="<?php the_ID(); ?>">More</a>

    also- in your js you're assigning the click function to the div, but then you're using the "this" reference to read the rel of the anchor tag, "this" in this context refers to the div, not the anchor, so you'll have to give the anchor that class, or use a descendant selector to read the rel attribute.

    also, you're sending the data via post, with a variable called "p", so the php script has to change to read the p post variable..

    query_posts('p='.$_POST['p']);

View thread