Ajax and wordpress

Out of context: Reply #12

  • Started
  • Last post
  • 16 Responses
  • Ravdyk0

    Ok I fixed all the stupid stuff and finally understand how this works. Thanks a lot for that!

    But now I am still encountering the problem of actually loading in the wordpress post.(Probably something stupid too)

    I tried making the query non dynamic to see if that was the source of the problem, but no luck. Can the problem be that the page where I am loading the content to all ready has a query loop and that they are conflicting?

    This is the code of my php file:
    <?php
    // Include Wordpress
    define('WP_USE_THEMES', false);
    require('../wp-load.php');
    query_posts('p=1');
    ?>

    <?php while (have_posts()): the_post(); ?>
    <h2><?php the_title(); ?></h2>
    <?php endwhile; ?>

    I am using the '../wp-load.php' because I am testing the site on sitename.com/index2.php

    I hope this makes sense. Thanks a lot for helping me so far!

View thread