Allah will make his scandal heard of, and whoever shows off, Allah will expose him.”
As for the hadith of Abu Hurayrah, it applies to anyone who pursues knowledge that is ordinarily sought for the sake of Allah’s Face—namely, the sacred sciences: the knowledge of the Book and the Sunnah. If a person studies any branch of that knowledge yet seeks nothing but some worldly advantage, he will not smell the fragrance of Paradise—that is, its scent, which can be perceived from a distance of many days’ travel. For instance, if someone studies creed so that people will say, “So-and-so has a sound creed,” or studies in order to secure a post, or anything similar; or if he learns jurisprudence, tafsir, or hadith merely to impress others, he will not smell the fragrance of Paradise—may Allah protect us—meaning he will be barred from entering it.