I’m fleshing out post formats in a child theme. For link-type posts, if a featured image hasn’t been set, I’d like to fetch the OpenGraph image associated with the link and display it.
I’ve found scottmac’s opengraph PHP library, which I assume would allow me to get that OpenGraph data. But how would I go about incorporating that into my child theme and using it? I assume it’s not as simple as placing
opengraph.php in my child theme’s directory, since that doesn’t really make sense, but I don’t know what actually does make sense.
It’s not so much harder then you thought.
include_oncePHP function in the child’s functions.php file (use
get_stylesheet_directoryfunction for getting path of the child theme)