testing result of $.post with json_encode

If you want to check the value of your JSON response in JS, you need to parse the JSON object you’re returning before trying to access any values: jsonResponse = JSON.parse(response); if (jsonResponse.success === true) { /*do something*/ }

WordPress display page information rather than post

I figured out a solution. It works, not entirely sure if it’s best practice but I queried the posts first and it seems to show up. Here’s my code; <?php query_posts(‘showposts=2’); if (have_posts()) : while (have_posts()) : the_post(); ?> I then closed the if statement with; <?php endif; wp_reset_query(); ?>

How can i order my posts by post type?

Here is solution for your prob dude add_filter( ‘posts_request’ , ‘modify_request’ ); function modify_request( $query) { global $wpdb; if(strstr($query,”post_type IN (‘review’, ‘directory’)”)){ $where = str_replace(“ORDER BY {$wpdb->posts}.post_date”,”ORDER BY {$wpdb->posts}.post_type”,$query); } return $where; }