Is it this that you're following?
https://docs.grabaperch.com/perch/pages-and-nav/page-attributes/facebook-and-twitter-sharing/
That's it! I can't seem to get it to work though
It looks like you're missing this:
# get the post $post = perch_blog_custom(array( 'filter' => 'postSlug', 'match' => 'eq', 'value' => perch_get('s'), 'skip-template' => true, 'return-html' => true, ));
Okay, so I've got this:
<?php include('admin/runtime.php');?> <!DOCTYPE html> <html lang=""> <?php $title = perch_blog_post_field(perch_get('s'), 'postTitle', true); perch_layout('global.header', array( 'title'=>$title )); ?> <body> <?php include('includes/analyticstracking.php'); ?> <?php include('includes/navigation.php');?> <?php $post = perch_blog_custom(array( 'filter' => 'postSlug', 'match' => 'eq', 'value' => perch_get('s'), 'skip-template' => true, 'return-html' => true, )); # set up the variables $title = $post['0']['postTitle']; $description = strip_tags($post['0']['excerpt']); if (isset($post[0]['fbimage'])) { $fbimage = $post[0]['fbimage']; } else { $fbimage = ''; } # use the variables in the array value perch_page_attributes_extend(array( 'description' => $description, 'og_description' => $description, 'og_title' => $title, 'og_type' => 'article', 'sharing_image' => $fbimage, 'og_author' => 'https://www.facebook.com/JohnMarkFilms', )); echo $post['html']; ?>
And still nothing
Do you have this somewhere lower in the process?
perch_page_attributes(array( 'template' => 'default.html' ));
Even with it, I got nothing.
You need it.
<?php $post = perch_blog_custom(array( 'filter' => 'postSlug', 'match' => 'eq', 'value' => perch_get('s'), 'skip-template' => true, 'return-html' => true, )); # set up the variables $title = $post['0']['postTitle']; $description = strip_tags($post['0']['excerpt']); if (isset($post[0]['fbimage'])) { $fbimage = $post[0]['fbimage']; } else { $fbimage = ''; } # use the variables in the array value perch_page_attributes_extend(array( 'description' => $description, 'og_description' => $description, 'og_title' => $title, 'og_type' => 'article', 'sharing_image' => $fbimage, 'og_author' => 'https://www.facebook.com/JohnMarkFilms', )); echo $post['html']; perch_page_attributes(array( 'template' => 'default.html' )); ?>
Right, I have this and nothing
So you're outputting the meta tags underneath your post. Is that what you intend? Are you looking for them there or in the head of the page?
In the head
Ok, so if you look further down the page after the post, are they there?
No there's not
I'm not sure I know how to help in that case.
Is it this that you're following?
https://docs.grabaperch.com/perch/pages-and-nav/page-attributes/facebook-and-twitter-sharing/
That's it! I can't seem to get it to work though
It looks like you're missing this:
Okay, so I've got this:
And still nothing
Do you have this somewhere lower in the process?
Even with it, I got nothing.
You need it.
Right, I have this and nothing
So you're outputting the meta tags underneath your post. Is that what you intend? Are you looking for them there or in the head of the page?
In the head
Ok, so if you look further down the page after the post, are they there?
No there's not
I'm not sure I know how to help in that case.