1) ? get_query_var('page') - 1 : 0; } public function nextPage() { return (get_query_var('page', 1) < FrontPage::totalPages()) ? get_query_var('page', 1) + 1 : 0; } public function latestBooksTitle() { return (empty(get_theme_mod('pb_front_page_catalog_title'))) ? __('Our Latest Titles', 'aldine') : get_theme_mod('pb_front_page_catalog_title'); } public static function latestBooks($offset = null) { $path = ($offset) ? "/wp-json/pressbooks/v2/books?per_page=3&page=$offset" : '/wp-json/pressbooks/v2/books?per_page=3'; $books = wp_remote_get(network_home_url($path)); $books = json_decode($books['body'], true); return $books; } }