Date and time fields or what we call timestamps stored in our Mysql databases has a format of “YYYY-MM-DD HH:MM:SS” or “2011-04-15 11:30:00″ . It is awkward for the users to to see dates outputted to something in that format, so for user readability and friendly purposes, we must output the date into something more [...]
Sometimes, you need to get some information from your wordpress database and display it outside your WP application. Here are some useful custom queries that you can use to get data from your Wordpress database.
1. Get and display recent posts query.
//get recent posts function
$query = "Select * from wp_posts
WHERE post_type = 'post'
AND post_status = [...]