From 67ba6bb820fb6f689fe85b11ce03c02796232e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 10 Oct 2017 11:26:37 -0400 Subject: [PATCH] closes #5977 --- src/controllers/topics.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/controllers/topics.js b/src/controllers/topics.js index 347ae8e847..d3a4846390 100644 --- a/src/controllers/topics.js +++ b/src/controllers/topics.js @@ -227,6 +227,8 @@ function addTags(topicData, req, res) { var ogImageUrl = ''; if (topicData.thumb) { ogImageUrl = topicData.thumb; + } else if (topicData.category.backgroundImage && (!postAtIndex || !postAtIndex.index)) { + ogImageUrl = topicData.category.backgroundImage; } else if (postAtIndex && postAtIndex.user && postAtIndex.user.picture) { ogImageUrl = postAtIndex.user.picture; } else if (meta.config['og:image']) {