Error thrown

Call to a member function get_main_post() on boolean