Return to Snippet

Revision: 40390
at February 1, 2011 07:23 by ericmuyser


Initial Code
$post = Blog_Post::create()->limit(1)->order('updated_at DESC')->find_all();
    
    if($post):
      $url = root_url($site_settings->blog->path) . 'post/' . $post->url_title . '/';
    
      preg_match_all('#<p>(.*)</p>#simU', $post->content, $m1, PREG_SET_ORDER);
    
      $trim = 250;
      $l_1 = strlen($m1[0][1]);
      
      if($l_1 < $trim)
        $content = '<p>' . $m1[0][1] . '</p>';
      else
        $content = '<p>' . substr($m1[0][1], 0, $trim) . ' ...</p>';

Initial URL


Initial Description


Initial Title
ls latest blog post except

Initial Tags


Initial Language
PHP