0

Is there a way of setting up my Wordpress blog so that the most recently edited blog post appears at the top of my homepage and any page to which it is linked?

  • HI Eli, for the first part, recent posts: yes - you could look 1) with a sidebar see if there is a widgets that show recent posts, maybe modify the code to query by modified date. or2) see if there is a shortcode that lets you query posts by some selectrion, or 3) modify the homepage template to query the most recent post and display what you want from it. This function would be useful codex.wordpress.org/Template_Tags/get_posts. – anmari Dec 17 '18 at 1:23
  • As for "any page to which it is linked". It sounds like you want to list all pages that have a link to that recently edited post? That could be a slow query as you'd basically have to search the content of all the pages looking for the link. And it will do that every time any one comes to the site. What is the need you are trying to address? Perhaps there is a better, more efficient way to do whatever it is you are trying to do. – anmari Dec 17 '18 at 1:25
  • See [WP_Query's date_query ](developer.wordpress.org/reference/classes/wp_query/…), look for 'column' => 'post_modified_gmt' between examples. – Max Yudin Dec 17 '18 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.