WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
if (have_posts()) :
while (have_posts()) : the_post();
$dVC []= $post->post_content;?>
<div id="featuredt-<?php echo $wp_query->current_post;?>">
<?php echo get_post_meta($post->ID, 'featuredt', TRUE);?></div>
<?php endwhile;

This is my loop at the moment.

I need the json encoded variable to look like ["0":content, "1":content] so I can use jQuery.parseJSON() on it. I don't mind people telling me about jQuery.getJSON() but I have less of an idea how to use it then parseJSON. Please provide detailed examples when explaining, I really would appreciate any help I could get though.

share|improve this question
let me get this right. You want to get the contents of the $dVC php variable in jquery. Is that correct? – Ijaas Nov 3 '11 at 2:23

Try outputting the JSON:

echo json_encode($dVC);
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.