The Buddha did not teach that only consciousness is real. He called such a view speculative, similar to a belief that only the material world is real. The buddhist teaching is, essentially, that the real is real and ever changing and that consciousness is merely a phenomenon of that which is reality.