Find Oldest Published Post
-
I have written a function that uses the single oldest published post, but it has been suggested it may be improved upon.
Currently I am identifying the oldest post with this snippet:
/* Get all posts */ $all_posts = get_posts('post_status=publish&order=ASC'); /* Get first post */ $first_post = $all_posts[0];
As this function is being used on every “public-facing page” is there a more efficient or less server intense method than the one I am using?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Find Oldest Published Post’ is closed to new replies.