function archive() { /* * Since there are several archive pages, we should bind this action to the archive * class after the common to assign all default options for archive pages */ /* * set base variables */ $this->View->add("wxp_content_template", WXP::get_path("#loop")->dir()); /* * if posts exceed the amount of that allotted per page, * tell view to include the pager nav */ global $wp_query; if ($wp_query->max_num_pages > 1) { $this->View->add("paged_archive", true); } /* * include the error no posts template if the archive has no posts */ if (!have_posts()) { $this->View->add("wxp_content_template", WXP::get_path("#error")->name("no-posts")->dir()); } }