<?php $dVC=array(); query_posts('meta_key=featuredt&posts_per_page=5'); 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; endif; json_encode($dVC); ?>
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.