By Anton on Wednesday, 17 October 2018
Posted in Technical Issues
Likes 0
Views 526
Votes 0
Hi,

May be you can help me.

I need php code so that I can put it between the <head> </ head> tag, where I could indicate the output of the picture from the article. I need this for widget for social network vk.com. And in each page I need to have in meta tag it's own picture's code
For example,
<meta property="vk:image" content=" php-code for image " />
If I will have this php-code, the social network will take picture from the page right.

Thanks.
Hi Anton,

Correct me if I'm wrong do you want to append the code in blog post entry view yes?
For get the image for entry you actually can use the code below:
[gist type="php"]
$id = EB::request()->get('id', 0, 'default');
$post = EB::post($id);
$post = EB::formatter('entry', $post);
echo $post->getImage('original', false, true, true);
[/gist]
Can you give it a try?

You're suggested to backup the file that you want to customize beforehand for precaution
·
Thursday, 18 October 2018 11:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Muhammad,

Thanks for help. Now it's almost good, but see please see the screen attached below, we need to remove the numbers before the image-link.
·
Thursday, 18 October 2018 16:23
·
0 Likes
·
0 Votes
·
0 Comments
·
Weird, seems like it echo the folder in the front of the image path.
Can you give us some screenshot of your code?
·
Thursday, 18 October 2018 17:23
·
0 Likes
·
0 Votes
·
0 Comments
·
Attached
·
Thursday, 18 October 2018 17:38
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Anton,

Can you put the variable outside the meta tag and just put the echo in and see how it goes eg: http://take.ms/mH1VC

You're suggested to backup the file that you want to customize beforehand for precaution
·
Thursday, 18 October 2018 18:29
·
0 Likes
·
0 Votes
·
0 Comments
·
I tried, but it doesn't work.
·
Thursday, 18 October 2018 19:03
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Anton,

Can you remove the space and see http://take.ms/FBw0D
·
Thursday, 18 October 2018 19:23
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks a lot! Now all is good!
·
Thursday, 18 October 2018 19:30
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome Anton Glad to hear your issue has resolved.

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.

Thanks for understanding and have a nice day ahead
·
Friday, 19 October 2018 10:35
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post