Gallery album social sharing image.
I'm attempting to pull an image from the album.php page into page attributes for social media sharing, without success.
The template code for the image I'm after is thus:
<perch:gallery id="image" type="image" key="two" width="1600" />
I placed the following in a page attributes file to no avail.
<meta property="og:image" content="<perch:pages id="domain" /><perch:gallery id="two" />" />
I've also unsuccessfully tried the following:
This in a header.php file (just showing the relevant bits here);
<?php $domain = 'https://'.$_SERVER["HTTP_HOST"]; $sharing_image = perch_gallery_image(perch_get('id'), array( 'skip-template' => 'true', ),true); PerchSystem::set_var('domain',$domain); PerchSystem::set_var('sharing_image',$sharing_image); ?>
Then this in a page attributes file;
<meta property="og:image" content="<perch:pages id="domain" /><perch:pages id="sharing_image" />" />
Still trying to figure this out myself but would appreciate any pointers. Thanks.
Want to reply to this thread?Login with Perch