I'm having an issue with something that must be simple but I just can't seem to figure it out.
Basically, I'm integrating Facebook Open Graph tags manually in my Wordpress site through functions.php
Everything is fine, except that I would like the "default image" (the image FB displays if the post doesn't have any images) to be different based on the category the post is in.
Since I'm not very experienced, I figured out a simple way (I think).
The categories in my site are peoples' names e.g. Bill Gates. I created a new folder: /wp-content/uploads/defaultimage/ and there I uploaded a picture for each category and I named them accordingly, e.g. Bill Gates.jpg
Now, at my functions.php, this is the part I'm having issue with:
$default_image="http://example.com/wp-content/uploads/defaultimage/" . the_category() . ".jpg";
How do I make the code to figure out which category the post is in and then grab the picture with that name that is located in the defaultimage folder?