get_previous_post() while accounting for sticky posts

Ok, this might be overcomplicating things a bit, but at least it should work (untested). Just call the function like so get_adjacent_without_sticky( get_the_ID(), true); // get previous post get_adjacent_without_sticky( get_the_ID(), false); // get next post This could have been solved easily, if get_previous_post() allowed for an ID to pass and not only run it in … Read more

How can I get rid of the automatically generating tags?

If you use a child theme, just add this function to your functions.php file: add_action( ‘after_setup_theme’, ‘foobar_setup’, 11 ); function foobar_setup() { global $editor_styles; $editor_styles = array(); } This works for me for details follow below links which I used as source of this solution : This post and another one

Using system date format

Calling get_the_date( get_option(‘date_format’) ); will return the exact same value as get_the_date(); this is because by default if a date format is not specified when the function is called it will use get_option(‘date_format’); as can be seen from the following snippet taken from the get_the_date() function itself: if ( ” == $d ) { $the_date … Read more

How to set post status to Delete?

You can move the post to Trash before you save it or publish: Or you can do it later, from the post list: Later you can empty Trash or it will automatically delete everything from Trash what is older than a month.

How to check if a post is published today?

You can use get_the_time() to get the date of the current post. Just use a format that only includes the year and date, and compare it to the current date using the current_time() function with the same format: if ( get_the_time( ‘Yd’ ) === current_time( ‘Yd’ ) ) { // Post was published today. }

Database hacked – random posts are modified

It’s possible that the random stuff is not in the database; your answer doesn’t make that clear. There could be some modified WP files that are inserting text in each displayed post. Recovering from a hacked system is time-consuming, but can be done. Short list: update WP/themes/plugins to latest versions. Check the htaccess file against … Read more