Share buttons in Wordpress meta og: image

0

Hi, I'm something new in creating wordpress templates from scratch. I recently created a theme. I wanted to add the share buttons on linkedin and FB. I want to say that when I give to share we only show the url of the post but also the image . The first thing I have achieved through a function and javascritp, but I do not give with the correct template tag or the suitable function to include to make the goal of open graph og: image work ... That is to say that it shows the image of the post . This is what I have in the head:

<meta property="og:site_name" content="<?php bloginfo('name'); ?>">
<meta property="og:type" content="website">
<meta property="og:url" content="<?php echo 'http://' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; ?>">
<meta property="og:title" content="<?php is_front_page() ? bloginfo('name') : wp_title(''); ?>">
<meta property="og:description" content="<?php if ( is_single() ) {single_post_title('', true); } else {bloginfo('description'); } ?>">
<meta property="og:image" content="#">

If someone could advise me to put in the content="" of the goal og: image I would appreciate it.

Thank you!

    
asked by Edu 06.10.2017 в 09:25
source

0 answers