treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Importing data table

  • Hey, everyone I'm attempting to import specific parts of a wordpress post to be displayed differently on the front page of a website. So far I have a thumbnail, the content, below. BUT what I'd really like to do is add a table to display data on the right hand side. Wondering if anyone has ever figured out how to do this dynamically.

    Also here is my code:

              <div class="fourcol">
                  <?php if(has_post_thumbnail()): ?>
                  <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), ''); ?>
                  <div class="block-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php echo $image[0]; ?>" alt="<?php the_title(); ?>" width='290' height='160' /></a><?php echo $icon; ?></div>
                  <?php else: ?>
                  <div class="block-image"><a href='<?php the_permalink(); ?>' title='<?php the_title(); ?>'><img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php bloginfo('template_directory'); ?>/images/thumbnail.png&w=290&h=160" alt="<?php the_title(); ?>" width='290' height='160' /></a><?php echo $icon; ?></div>
                  <?php endif; ?>
    
    
    </div> 
    
    <?php if(function_exists('the_ratings')) { the_ratings(); } ?>
    <?php if(function_exists('the_ratings')) { the_ratings(); } ?>
    <br class="clear">
    
                <div id="twelvecol">                 
    
    <?php
         ob_start();
         the_content();
         $postOutput = preg_replace('/<img[^>]+./','', ob_get_contents());
         ob_end_clean();
         echo $postOutput;
      ?>
     </div>