/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php if (is_page('about')) { $sql = "SELECT posts.* FROM $wpdb->posts posts INNER JOIN $wpdb->term_relationships termrel ON posts.ID = termrel.object_id WHERE termrel.term_taxonomy_id = 8"; $about_posts = $wpdb->get_results($sql, OBJECT); ?> <?php if ($about_posts) { ?> <ul class="practitioner_list" id="practitioner_list"> <?php foreach ($about_posts as $aboutpost) { ?> <li><a href="<?php echo $aboutpost->guid; ?>"><?php echo $aboutpost->post_title; ?></a> <p><?php echo $aboutpost->post_excerpt; ?></p></li> <?php } ?> </ul> <?php } ?> <?php } ?>