#wordpress 2024-02-05

2024-02-05 UTC
#
havacow
nsmsn[d]: Does Mastodon use Open Graph?
#
IWDiscord
<h​avacow>
#
havacow
If so, this should work:
#
havacow
`<?php
#
havacow
$featured_image_url = get_the_post_thumbnail_url();
#
havacow
if (has_post_thumbnail()) {
#
havacow
} else {
#
havacow
$featured_image_url = get_template_directory_uri() . '/assets/logo-schema.png';
#
havacow
<meta property="og:image" content="<?php echo esc_url($featured_image_url); ?>">`
#
IWDiscord
<h​avacow>
#
havacow
You could remove the else statement if you'd like but I have it in place in my theme as a fallback image in case the post does not have a featured image.
#
havacow
Add this to your <head> tag in your header.php file.
#
nsmsn
Thanks, havacow[d] !
#
havacow
You bet. Nice looking website btw. I took a peak via your profile.
[Joe_Crawford] joined the channel
#
nsmsn
Ah, thanks!
[hello092], [Murray], Loqi, Gremblo[d], ytseboy[d], erscheinung[d], againstthefuture, hidjy[d], marmadilemanteat, the_kovah[d], IWDiscord, Loqi__, [KevinMarks], chee, [Ana_R], [Paul_Robert_Ll], gRegor, shreyan1, [tantek], [snarfed] and [aciccarello] joined the channel