Can you be pregnant if you have yellowish discharge?

It depends at what point in your cycle the yellow discharge appeared and the consistancy of it. If you are at the end of your cycle but had unprotected sex approx 14 days before your period was due then yes you may be pregnant and a test would be suggested. However, if you had unprotected sex around the same time you noticed the yellow discharge then it is unlikely that you would conceive. The discharge produced at the time of ovulation is clear and you should be able to stretch it between your thumb and forefinger (as gross as that sounds!).