How to draft posts after being published with x days

I would suggest you use wp_schedule_event() and create a custom hook that you trigger daily. This hook can then call a custom function in which you query posts with the desired publish date, and change their status. For example, create a new plugin and add (note: I have not tested this): // Schedule auto-drafting post … Read more

Filter posts by month (dropdown)

You can try to use wp_get_archives() function. Example from this link: <select name=”archive-dropdown” onchange=”document.location.href=this.options[this.selectedIndex].value;”> <option value=””><?php esc_attr( _e( ‘Select Month’, ‘textdomain’ ) ); ?></option> <?php wp_get_archives( array( ‘type’ => ‘monthly’, ‘format’ => ‘option’, ‘show_post_count’ => 1 ) ); ?> </select>

posts_per_page is not working on my end

It’s not working because the $posts_list variable is assigned the return value of get_posts() (i.e. $posts_list = get_posts( … )), hence $posts_list is not actually an array of arguments, but instead, it’s either an array of posts or an empty array. So to fix the problem, define the $posts_list like so: $posts_list = array( ‘posts_per_page’ … Read more

Blog posts pagination not working

The most common problem of similar questions I see on WPSE – contributors confused about template hierarchy.In your case, it’s better to check Common WordPress template files section here These items most important for your question: front-page.php The front page template is always used as the site front page if it exists, regardless of what … Read more

How to put the author of the post in the comments?

Not sure it’s the shortest way, but it works) Get post author id $post_author_id = get_post_field( ‘post_author’, $c->comment_post_ID ); Get author data by id $post_author_display_name = get_the_author_meta( ‘display_name’, $post_author_id ); Try this shorter version $output.= get_the_author_meta( ‘display_name’, get_post_field( ‘post_author’, $c->comment_post_ID ) ); Check documentation page which data is available with get_the_author_meta()