!Fix meta tag og:image always displays
Closed this issue · 5 comments
Hello, the meta tag "og:image" always displays on the website whether we check "Use the image from the first topic message in the meta tag og:image" or not.
I think we should fix a litte bit in Sources/Optimus/Subs.php
Find (line 150):
if (empty($settings['og_image'])) {
Replace with:
if (empty($settings['og_image']) && empty($modSettings['optimus_og_image'])) {
P/S: I edited the replace value!
og:image is a required tag, see https://www.ogp.me/ for additional info.
I see mate, but when we want to use first topic image on the facebook, then the og:image shouldn’t be display!
That’s just a little fix. Please see in action on my fanpage: https://facebook.com/layphatvn . It’s using both first topic image and og:image website setting!
Your fix works with Facebook, I see. But what about other services? For example, Yandex Webmaster shows an error due og:image is empty/not exist.
I removed this block fully, see the commit
Nice, but actually we still have the $modSettings['optimus_og_image'] value at the Admin CP: yourforum/index.php?action=admin;area=optimus;sa=extra, that we can chose option "Use the image from the first topic message in the meta tag og:image" or use OG Image on current theme! [defined with function extraTabSettings($return_config = false) in Sources/Optimus/Settings.php]
In my opinion, we should hold that block and change a little bit:
if (empty($settings['og_image'])) {
change to
if (empty($settings['og_image']) && empty($modSettings['optimus_og_image'])) {