Have a go at the free sample chapters of my book at the link in my sig. It focuses on simple, creative uses of theory, step by step, and teaches you how to work out what sorts of intervals and melodic fragments you like, what sorts of simple rhythmic variations you like and how to work with harmony. There's also some work on learning to find notes on the fingerboard, so if you combine all if this, you can improve your ability to write interesting lines while improvising. If you have any difficulty with it then you can reach me here or at the Facebook page and I can answer any questions which may arise.
I agree that learning things by ear is also useful, as is jamming with backing tracks, just remember to analyse the bits of your improvisation which you like, to understand what you played so you can better use your experience in future and do so on demand.
I hope this helps. Let me know if I can help any further.