Jump to content

uuragoda

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by uuragoda

  1. Sweet! yes my date field is called news_date. Thanks again. Processwire looks interesting. Thanks again for your quick response.
  2. Hi @Wanze, we are getting there. sort=-created got my articles displaying. But how do I sort it by date? I tried $items = $page->find("parent=/about/newsroom, limit=12, sort=-date"); But it doesnt seem to do anything.
  3. Hi, Im new to processwire and the website I have this problem with was build by a third party company. I have some problems with displaying page items on the homepage with the script below. Heres the story; I have a Newspage and I have listed about 20 news articles on this page. Link to news page : http://dev2.aot.com.au/about/newsroom/ I have a 'chunk' script calling these news articles and displaying on the home page with the script below. http://dev2.aot.com.au/ <?php $items = $page->find("parent=/about/newsroom, limit=12"); $numItems = count($items); $numPerContainer = 12; $itemx = 0; foreach($items as $newsItem): ?> <?php if ($itemx % $numPerContainer === 0):?> <div id="car-dis" class="outer owl-carousel"> <?php endif; ?> <div class="news-item"> <span class="news-date"><?php echo $newsItem->get('news_date'); ?></span> <h3 class="news-title"><a href="<?php echo $newsItem->url; ?>"><?php echo $newsItem->title; ?></a></h3> <p><?php echo $newsItem->news_introtext; ?>...</p><p><a class="post-cta" href="<?php echo $newsItem->url; ?>">READ MORE</a></p> </div> <?php if ($itemx % $numPerContainer === 11 || $itemx === $numItems): ?> </div> <?php endif; ?> <?php $itemx++; endforeach; ?> The problem is, the home ppge news items doesn't show the latest 2 items I added recently. Does anyone know why?
×
×
  • Create New...