How to get the latest posting time of archived pages in WordPress?

Query the posts ordered by date, restricted to 1 post to display, then get the date. $args = array( ‘posts_per_page’ => 1, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’ ); $lastpost = get_posts($args); echo $lastpost[0] -> post_date; Edited last line for proper display: $lastpostdate = $lastpost[0] -> post_date; echo ‘<div class=”lastpostdate>”‘ . $lastpostdate . ‘</div>’; Or, … Read more

Posting via email, where do I start troubleshooting?

You’re obviously posting it to a mailbox that WordPress is accessing, so check the mailbox that your friend has sent an email to, if the email is still in there then WP hasn’t taken it out and thus your email settings in WP are probably wrong. If the email isn’t in there your friend has … Read more

Delete Post From Front-End and attachment permanently

Try: <?php if (current_user_can(‘edit_post’, $post->ID)) echo “<a href=”” . wp_nonce_url(“/wp-admin/post.php?action=delete&amp;post=$id”, “delete-post_’ . $post->ID) . “‘>Delete post</a>” ?> You can decide when to empty the WordPress trash by adding this code to the wp-config.php file in your WordPress root directory. define(‘EMPTY_TRASH_DAYS’, 1 ); The 1 in the code signifies you want to empty the trash everyday. … Read more

Featured Posts for Category Pages

assign the additional category ‘featured’ to the post in the category ‘medical’. in your category template, use a query with ‘category__and’ => array(3, 27) example (assuming ‘medical’ is cat 3, and ‘featured’ is cat 27): <?php $args = array( ‘category__and’ => array(3, 27), ‘posts_per_page’ => 1 ); $feature = new WP_Query( $args ); if( $feature->have_posts() … Read more