Custom Export for Table Contents
-
Hi,
I’m trying to query two cells of a table for each post I have:
http://dl.dropbox.com/u/1739837/Screenshots/5a.png
What is the best way to query these two rows?
<?php /* Template Name: Table Export */ ?> <?php global $post; $args = array( 'numberposts' => 10, 'orderby' => 'post_title', 'order' => 'DESC', 'cat' => 1, 'post_status' => 'publish' ); $myposts = get_posts( $args ); foreach( $myposts as $post ) : setup_postdata($post); ?> <?php $theContent = get_the_content(); $table_id = false; if (preg_match('/\[table\ id=(\d*).*\]/im', $theContent, $r)) { if (isset($r[1])) { $table_id = $r[1]; } } ?> <div><?php echo $theContent; ?> </div><br /><br /> <strong>Table Name = <?php wp_table_reloaded_print_table_info('id=' . $table_id . "&field=name" ); ?></strong><br /> <strong>Author <?php wp_table_reloaded_print_table_contents('id=' . $table_id . $row_1 ); ?></strong> <strong>Bio <?php wp_table_reloaded_print_table_contents('id=' . $table_id . $row_2); ?></strong> <?php endforeach; ?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Custom Export for Table Contents’ is closed to new replies.