I was having the same issue one TWO of my 2013 retina MacBook Pros. I figured it was a bug with El Cap.
I would plug in my iPhone to charge and it wouldn't charge. Nor would it sync with iTunes. However a reboot of the machine and it was fine.
Last night I went out and say Jurassic World and came home to find my MacBook had only 10% life on it. It told me to plug it in... But it was plugged in.
So I grabbed one of the power adapters from my other MacBook pros and plugged it in. It would not charge either.
I got worried and started searching online. I did a SMC reset and the orange charge light came on, on the charging cable. I left it alone all night last night and work up to find the charging light green. I was happy... Until I turned it on to find out it only charged to 17% overnight.
Took it to the Apple Store today and they couldn't get it to charge either. They tell me it's going to cost $310 to replace the main logic board, which sucks because my apple care expired last week.
Now I am hoping the other MacBook Pro which has been showing the same signs (not always recognizing things plugged into the sub) is not on its way out too.
Again up until last night I just thought this was an El Cap bug.