• 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)
  • Thread Starter Preserved

    (@preserved)

    More on this. I’ve sort of got something working:

    <div class=”entry-content”>
    <p><?php _e(‘Interested in what I have to say by category? Well you can search below…’, ‘genesis’); ?></p>

    <h4><?php _e(‘Exhibitors’, ‘genesis’); ?></h4>

    </div>

    The above works, however I’d like to include some information that’s in the posts_meta table. I’d like the link that surrounds the title to be the www entry for this post which is held in the meta data. Is there a way? or am I going down a dead-end by using wp_query?

Viewing 1 replies (of 1 total)

The topic ‘Query and display data (custom posts?)’ is closed to new replies.