<?php /* Template Name: Blog */ $thePosts=TPost::findAll(); WpMvc::app()->view->render('blog',array('thePosts'=>$thePosts)); ?>
protected function getPosts() { return TPost::findAll('cat='.$this->id); }
<?php $thePost=TPost::defaultPost(); $listPage=TPost::findAll(array('post_type'=>'page','post_status'=>'publish')); WpMvc::app()->view->render('page',array('thePost'=>$thePost,'listPage'=>$listPage)); ?>
<?php $pagesize=isset($pagesize)?$pagesize:5; $popularPost=TPost::findAll('orderby=comment_count&order=DESC&posts_per_page='.$pagesize);?> <div class="widget most-commented"> <h3>Most Commented</h3> <ul> <?php foreach($popularPost as $popPost):?> <li><a href="<?php echo $popPost->permalink;?>"><?php echo $popPost->title;?></a> (<?php echo $popPost->commentCount;?>)</li> <?php endforeach;?> </ul> </div>
<?php $thePost=TPost::defaultPost(); $otherPosts=TPost::findAll(array('post_not_in'=>array($thePost->id))); WpMvc::app()->view->render('single',array('thePost'=>$thePost,'otherPosts'=>$otherPosts)); ?>
<?php $memoList=TPost::findAll(array('posts_per_page'=>4)); WpMvc::app()->view->render('home', array('memoList'=>$memoList));