How to get future ID for post which haven’t been created yet?

You are on the correct path on thinking about post-edit.php. http://core.trac.wordpress.org/browser/tags/3.3.1/wp-admin/post-new.php#L45 See how get_default_post_to_edit is called to return a new post. The second argument tells it to create a post in the database. The function is defined here: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-admin/includes/post.php#L394 Note line 422: $post_id = wp_insert_post( array( ‘post_title’ => __( ‘Auto Draft’ ), ‘post_type’ => $post_type, … Read more

Display all months with posts and inside each month show the 5 latest posts

one possibility is to run all posts through the loop and only output the month once per new month: <?php $counter = 0; $ref_month=””; $monthly = new WP_Query(array(‘posts_per_page’ => -1)); if( $monthly->have_posts() ) : while( $monthly->have_posts() ) : $monthly->the_post(); if( get_the_date(‘mY’) != $ref_month ) { if( $ref_month ) echo “\n”.'</ul>’; echo “\n”.'<h6>’.get_the_date(‘F’).'</h6>’; echo “\n”.'<ul>’; $ref_month … Read more

Display comments of users on single page

You can use the get_comments function to retrieve comments from a specific user. $comments = get_comments( array( ‘user_id’ => 1 ) ); foreach( $comments as $comment ) { $post_id = $comment->comment_post_ID; $post = get_post( $post_id ); setup_postdata( $post ); echo ‘<a href=”‘ . get_permalink() . ‘”>’ . get_the_title() . ‘</a>’; echo $comment->comment_author . ‘<br />’ … Read more