Jump to content

Search the Community

Showing results for tags 'blog archive'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 2 results

  1. Hi guys, I have created a basic blog archive using some code from this article which works fine on showing the amount of posts for each month and year: http://processwire.c...blogs-sections/ On clicking on the urls they bring me to a page blog/year/month however shows all blog items as opposed to just those in that year. Does anyone have any ideas? My code can be seen below which posts the month and amount of articles, I need to call the excerpts for each page. The code can be seen below: <?php $channel = $pages->get("/blog/"); $startYear = date("Y"); // this year $endYear = 2009; // or whenever you want it to end $now = time(); for($year = $startYear; $year >= $endYear; $year--) { for($month = 12; $month > 0; $month--) { $startTime = strtotime("$year-$month-01"); // 2011-12-01 example if($startTime > $now) continue; // don't bother with future dates if($month == 12) $endTime = strtotime(($year+1) . "-01-01"); else $endTime = strtotime("$year-" . ($month+1) . "-01"); $entries = $channel->children("created>=$startTime, created<$endTime"); // or substitute your own date field $date = date("F, Y",$startTime); $url = "/blog/" . date("Y",$startTime) . "/" . date("m",$startTime); $count = count($entries); if($count > 0) echo "<p><a class='article-list__link' href='$url'>$date <b>(" . $count . ")</b></a></p>"; // output the month and count } } ?> Any help would be greatly appreciated, Mel
  2. Hi guys, I have created a basic blog archive using some code from this article which works fine on showing the amount of posts for each month and year: http://processwire.com/talk/topic/263-creating-archives-for-newsblogs-sections/ On clicking on the urls they bring me to a page blog/year/month however shows all blog items as opposed to just those in that year. Does anyone have any ideas? My code can be seen below which posts the month and amount of articles, I need to call the excerpts for each page. The code can be seen below: <?php $channel = $pages->get("/blog/"); $startYear = date("Y"); // this year $endYear = 2009; // or whenever you want it to end $now = time(); for($year = $startYear; $year >= $endYear; $year--) { for($month = 12; $month > 0; $month--) { $startTime = strtotime("$year-$month-01"); // 2011-12-01 example if($startTime > $now) continue; // don't bother with future dates if($month == 12) $endTime = strtotime(($year+1) . "-01-01"); else $endTime = strtotime("$year-" . ($month+1) . "-01"); $entries = $channel->children("created>=$startTime, created<$endTime"); // or substitute your own date field $date = date("F, Y",$startTime); $url = "/blog/" . date("Y",$startTime) . "/" . date("m",$startTime); $count = count($entries); if($count > 0) echo "<p><a class='article-list__link' href='$url'>$date <b>(" . $count . ")</b></a></p>"; // output the month and count } } ?> Any help would be greatly appreciated, Mel
×
×
  • Create New...