custom wordpress page

Posted by sharon on Stack Overflow See other posts from Stack Overflow or by sharon
Published on 2010-04-19T02:53:14Z Indexed on 2010/04/19 3:23 UTC
Read the original article Hit count: 408

Filed under:

I'd like to implement a custom post retrieval page in wordpress. Basically, I'm using AJAX to call this page that will be passed a post ID and retrieve certain data from that post.

Note: please don't mistake this as a template question. I do not want a template for one single page -- I am looking to make this page query multiple different posts based on postID and return certain data from that post.

So I tried creating a page

<?php
$args=array(
       'p'=>'77'
    );
    $friends = new WP_Query($args);
?>
<?php if ($friends->have_posts()) : the_post(); ?>

    <?php the_title(); ?>
    <?php the_content(); ?>

<?php else: ?>
    <p>Sorry, no posts are available.</p>
<?php endif; ?>

But this does not work since it is not loading in the wp functions to handle the query.

Thanks in advance for any help!

© Stack Overflow or respective owner

Related posts about Wordpress