php - write og:image src into header of category pageGet the solution ↓↓↓
I'm still just groping around with WP and PHP. You know, monkey see monkey do?
I have a custom category page in my twentyseventeen-child theme,
category-mypage.php which calls
get_header() at the top in the ordinary way. At the top of the body of the resulting page, and below the standard header and menu, I have a manually created (copy/paste from a theme-generated post (monkey see monkey do))
<div class="single-featured-image-header" ... > <img class="attachment-twentyseventeen-featured-image size-twentyseventeen-featured-image" ... /> </div>
get_header() creates a
<meta> tag in the
<head> with an
og:image property that references the site's default header image.
Is there any way to rewrite this specific category page
<head> so that the
og:image property points to this
<img src= url instead of the site's header image?
Share solution ↓
Link To Answer People are also looking for solutions of the problem: string literal contains an unescaped line break
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.