Query and display data (custom posts?)
-
I’m looking to query the wp_posts table for a specific post type, then display it on a page.
So far I’ve come up with this, and when placed on a custom template it does nothing~:
<?php
global $wpdb;
$customers = $wpdb->get_results(“SELECT * FROM wp_posts WHERE post_type = ‘businesses;”);wcho “<table>”;
foreach($customers as $customer){
echo “<tr>”;
echo “<td>”.$customer->post_title.”</td>”;
echo “</tr>”;
}
echo “</table>”;
?>What am I missing?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Query and display data (custom posts?)’ is closed to new replies.