Jump to content

Adohgg

Members
  • Posts

    3
  • Joined

  • Last visited

Adohgg's Achievements

Newbie

Newbie (2/6)

0

Reputation

  1. Worked like a charm. Thanks a lot!
  2. I'm trying to use this code to get the most recent pages created and display them. I found this code on the wiki, but how would I make it display the most recent ones instead of the oldest ones?
  3. function newsList(){ // Grab the page name from the url $thisCategory = wire("page")->name; // If the category is not called "news" then output the category name as a selector for the find. if($thisCategory !="news") { $category = "article_category.name=" . $thisCategory; } // Get the news posts - limited to ten for later pagination $newsposts = wire("pages")->find("parent=/news-articles/, $category, template=TUT_news, limit=3"); $out =" "; //Loop through the pages foreach($newsposts as $newspost){ $out .="<div class='clearfix'>"; if($newspost->article_thumbnails){ $out .="<a href='{$newspost->article_thumbnails->url}' class=''>"; $out .="<img class='align_left' src='{$newspost->article_thumbnails->getThumb(listingthumb)}'>"; $out .="</a>"; } $out .="<a href='{$newspost->url}'><h3>{$newspost->title}</h3></a>"; $out .="<p>{$newspost->article_introtext}</p>"; $out .="</div>"; } echo $out; } I'm trying to use this code to get the most recent pages created and display them. I found this code on the wiki, but how would I make it display the most recent ones instead of the oldest ones?
×
×
  • Create New...