Jump to content

Андрей

Members
  • Posts

    34
  • Joined

  • Last visited

Community Answers

  1. Андрей's post in conclusion of the article was marked as the answer   
    <?php
    // make our own summary from the beginning of the body copy
    // grab the first 255 characters
    $summary = substr($story->body, 0, 255);

    // truncate it to the last period if possible
    if(($pos = strrpos($summary, ".")) !== false) {
        $summary = substr($summary, 0, $pos);
    }
    where to insert the code Ryan, below is my code that I use to display the
    <div id="main"><?php echo $page->main; ?>
                                      <?php foreach($pages->get("/sections/")->children as $child) : ?>     <div class="one_third first column_container">     <div class="portfolio-image-holder">     <div class="portfolio-image">             <a href='<?php echo $child->url; ?>'>                 <img src='<?php echo $child->images->first()->url; ?>'>             </a>         </div>     </div>     <?php       echo "<h1><a href='{$child->url}'>{$child->title}</a></h1>";     echo "<p>{$child->text}</p>";     //  displaying text in the field     ?>      </div> <?php endforeach; ?>                      </div>
×
×
  • Create New...