ajax content
-
calling this function with jQuery to load content into page with ajax
problem is the $post array isn’t getting established and therefore I cannot retrieve values such as $post->ID
any ideas why the_content works but the $post array is not there?
‘function post_loader_show_post ( ) {
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
?>
<div <?php post_class() ?> >
<h1 class=”title”><?php the_title();?></h1>
<?php
$subK = ‘subtitle’;
$subT = get_post_meta($post->ID, $subK, TRUE);
if($subT != ”) {
echo $subT;
}
?>
<?php the_content();?>
</div>
<?php
endwhile;
die();
endif;
}’
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘ajax content’ is closed to new replies.