/** * Generates and returns the collection of posts * * @return Fishpig_Wordpress_Model_Mysql4_Post_Collection */ protected function _getPostCollection() { if (is_null($this->_postCollection) && $this->getWrapperBlock()) { $this->_postCollection = $this->getWrapperBlock()->getPostCollection(); if ($this->_postCollection) { if ($this->getPostType()) { $this->_postCollection->addPostTypeFilter($this->getPostType()); } if ($this->getPagerBlock()) { $this->getPagerBlock()->setCollection($this->_postCollection); } } } return $this->_postCollection; }
/** * Ensures that only posts and not pages are returned * WP stores posts and pages in the same DB table * */ protected function _initSelect() { parent::_initSelect(); $this->getSelect()->order('menu_order ASC'); return $this; }