retrieve the oldest post id
题
I'm trying to get the ID of the oldest post with the post_type = job_listing
and post_status = publish
. I'm using the code below but it does not work. Could anyone please help me
$oldestID = mysql_query("select id from wp_posts where post_type = 'job_listing' and post_status = 'publish' order by post_date ASC");
Thanks!
没有正确的解决方案