Iphone says it's not charging on the symbol but is charging only at certain times?

Iphone says it's not charging on the symbol but is charging only at certain times?

Check your power cord. If the cord is damaged in any way, that could be the problem.

Could be lint or dust in your charge port. Try airing it out blowing thru the port also could try toothpick n put in their gently to seebif lint. If still don't after then could try different outlet then finally just get new charger

I have done both of those and it still isn't