Hey there,
First of all. I'd like to throw it out there that I once had a creative block that lasted over 2 years, so you're not alone in getting that feeling sometimes. I eventually overcame it, it just took me letting it go completely so I could come back to it fresh. I do feel bad about "wasting" two years of time, but it's what needed to happen in order for me to get to a place where I can produce consistently now.
There are a number of ways you could learn music theory, but I'm afraid most of them cost money. You can get a private teacher in your area, or hire one that you meet with over Skype. I actually personally do this, I have over ten years of performance and about 7 or 8 years of theory. Admittedly, I haven't taught in a while, but if you're interested, let me know. You can also get a performance teacher, and learn to play that way, and it will help you equally as much as learning theory. You can take some basic courses online, I know, just search "beginner music theory courses". I know Berklee School of Music has many courses, for example, but they cost about $1300 a pop.
The other way would be to buy some textbooks and work through them yourself. Having a small keyboard, even just a MIDI keyboard would help you immensely, with both the beat-making and the theory training. One thing you have to know about this, though, is that it is, for most, painstaking and tedious work that you absolutely despise as you're doing it.
Another method would be to learn by ear, if you have a good ear. If you have a MIDI keyboard, you can listen to songs that you like from YouTube or whatever and learn to play along with the simpler melodies based on what you hear. The more you do this, the more you will be able to recreate or even just knock off melodies with slight variations in order to make new beats. It's not glamorous but it works. You should also know that in order to create more complex beats, you will actually need to train yourself in music theory or even just performance, where you learn your technique (scales, basic melodic movements, etc.)
Good luck, and if you have any questions, feel free to ask.