Hot answers tagged


This is essentially a SQL question. The only possible WordPress related component would be if you were asking about database structure, which is in the Codex. Or you could just look at the database itself. The post ID is incremented and never duplicated. The highest IDs are the last added. The query is simple. SELECT * FROM {$wpdb->posts} WHERE ...


Easiest way to control column and/or row layouts I know of is to make use of modulus. I broke it down in a tutorial and use it with wordpress in my examples. Wordpress and PHP Modulus The first example is basic, while the second is a bit more advanced and utilizes post images/attachments. If it helps let me know or give the page a +1 for me :-)


Edit: You have an extra underscore in your table name, it becomes wp__posts in your case. Better use like how I have shown below :) First, use table names like the following and try var_dump to see if it returns NULL. In case the Post ID doesn't exist, $product will be NULL, which only var_dump can show. $product = $wpdb->get_row("SELECT * FROM $wpdb-...

Only top voted, non community-wiki answers of a minimum length are eligible