I am trying to build a framework essentially for WordPress Developers to help develop Themes and Theme Frameworks more efficiently and faster.
How ever, I am having a small issue by putting the wordpress loop into a class, this is what I have:
class AisisCore_Template_Helpers_Loop{
protected $_options;
public function __construct($options = null){
if(isset($options)){
$this->_options = $options;
}
}
public function init(){}
public function loop(){
if(have_posts()){
while(have_posts()){
the_post();
the_content();
}
}
}
}
Keep in mind the simplicity of the class for now. All you have to do is:
$loop = new AisisCore_Template_Helpers_Loop();
$loop->loop();
And you should see the list of posts.
How ever, it appears that posts do not appear. Is there something preventing the WordPress loop from working?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…