Unfortunately, that was one of the first variations of the code, and it did not work :(
I continued to tinker with the code and found something that works :) Yay!
My final code looks like: http://pastebin.com/8ixt6z6v.
Basically, in this version a couple of things changed:
1. I changed the
if to make sure that the parent category exists and that we have a post, if both of those conditions are met then it will display my content...if not, it does nothing.
2. Since the
else wasn't working I wrote my own...that says...if the parent category or the child category doesn't exist than display my error message...if so, than do nothing.
Not sure why the else doesn't work, but my guess is it's because of the
foreach that's the only thing that's different in this loop, that's not in most other loops.
Hope this helps someone else :)
Thanks wpcanyon for all your help!!