After a recent update to iTunes and iOS I can only play the music in my phone when I'm connected to the internet. When I choose the option for show offline music it only shows 4 songs that I have added recently after the update. How do I get all my music library to play offline again? P.S this happened after the Apple Music update.
Apple Music made some fundamental changes to the way the Music app works (when enabled). You now have your entire Apple Music Library in the cloud so that it is accessible from all your devices. With this, all of that content is not automatically downloaded to your device, and in fact, the opposite can occur as Apple uploads music to their cloud.
So now, you must specifically download whatever content you would like to listen to offline. To do that, open the Music app and navigate to a playlist, album, artist, or song that you would like to download. Now select the "..." (ellipsis menu icon) and choose "Make Available Offline". After the songs download, an icon will display next to each one indicating that it is available for offline listening.
You can also download your tracks directly from the album/playlist view:
If you don't have any subscription of the Apple Music service or iTunes Match, and if you had your iPhone synced with an iTunes Library on a Mac/PC, you are safe.
Just plug your iPhone in the computer you had it synced with (previous to the software update) and synchronise it with the iTunes Library. Your songs should be transferred again into the Music app. Note that your local files will be stored under the My Music tab.