WordPress.org

Ready to get started?Download WordPress

Forums

[LifeStream Plugin] Split stream into two columns (1 post)

  1. abiwab
    Member
    Posted 4 years ago #

    Hi ! I've recently downloaded a WordPress theme (Iressistible) which features a "Lifestream" widget. Everything works great, I can see my tweets. But the thing is I would like to split my lifestream into two columns in this box. Here's what I've managed to do so far : http://www.willandco.fr/lifestreambox.png
    In fact I just created 2 CSS class to get 2 columns, and then in the message.inc.php file I duplicated the code to get in each column the same feed. This is the code I get :
    :

    <div class="left">  <div class="lifestream_meta"><abbr title="<?php echo date("c", $event->timestamp); ?>" class="lifestream_hour"><?php echo date('D d M , G:i:s', $event->timestamp); ?></abbr></div><?php foreach ($event->data as $chunk) { ?>
    <div class="lifestream_label"> <?php if ($lifestream->get_option('show_owners')) { echo $label_inst->get_user_label().': '; } ?><?php echo $this->render_item($event, $chunk); ?></div>
    <?php if ($show_metadata) { ?>
    
    <?php } ?>
    <?php } ?>
    </div>
    <div class="right"><div class="lifestream_meta"><abbr title="<?php echo date("c", $event->timestamp); ?>" class="lifestream_hour"><?php echo date('D d M , G:i:s', $event->timestamp); ?></abbr></div><?php foreach ($event->data as $chunk) { ?>
    <div class="lifestream_label"> <?php if ($lifestream->get_option('show_owners')) { echo $label_inst->get_user_label().': '; } ?><?php echo $this->render_item($event, $chunk); ?><?php if ($show_metadata) { ?></div>
    
    <?php } ?>
    <?php } ?>
    </div>

    What I would like to do now is to split the stream into two columns, I mean I want to read in the left column the first 4 results, and on the right column the 5-8 results. How could I do that ? I've searched on the plugin homepage and the creator gives this following code (http://www.ibegin.com/labs/forums/index.php?topic=120.0) :

    // this will return results 20-40 from your lifestream, perfect for pagination
    $results = lifestream_get_events(array(
      'offset' = 20,
      'number_of_results' = 20,
      'date_interval' = -1,
    ));

    So this code should display results 20 to 40 of my stream. I guess I could use this to display in one column results 1 to 4 and on the other 5 to 8 right ? But where should I paste this code ? I really don't know much about PHP, so if someone could give me some help that would be awesome ! Thanks :)

Topic Closed

This topic has been closed to new replies.

About this Topic