Hi, joyryde, I’m another Neve user.
I did a quick search for the meta tags and just realized that you were right. The theme doesn’t generate open graph meta tags.
No open graph meta tags are generated using the content from the page with the theme.
You could try something along the lines of this code that I wrote, although it doesn’t account for the existing meta graph tags you have on your site:
define('current_theme_name', 'Neve');
$theme = wp_get_theme(); // gets the current theme
if ( current_theme_name == $theme->name || current_theme_name == $theme->parent_theme ) {
add_action( 'wp_head', 'add_meta_tags_hestia' , 10 );
}
function add_meta_tags_hestia()
{
if (is_page()):
global $post;
?>
<meta property="og:title" content="<?php echo get_the_title($post);?>"/>
<meta property="og:image" content="<?php echo get_the_post_thumbnail_url($post)?>" />
<meta property="og:description" content="<?php echo get_the_excerpt($post)?>"/>
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="<?php echo get_the_title($post);?>"/>
<meta name="twitter:description" content="<?php echo get_the_excerpt($post)?>"/>
<meta name="twitter:image" content="<?php echo get_the_post_thumbnail_url($post)?>" />
<?php
endif;
}
Note it only applies to pages.
Where are those existing metagraph tags coming from on your site?`
-
This reply was modified 4 years, 9 months ago by
Ian Sackofwits. Reason: wrong theme
Hi Ian!
The Rank Math plugin creates the OG tags, but according to them, it’s the themes flaws that cause this and their tags can’t resolve the issue until the theme is fixed.
I appreciate the code! I’ll try to modify it and see what happens!
Hi @joyryde!
Please make sure you added the featured image to Rank Math -> Titles & Meta -> OpenGraph Thumbnail and saved the changes, as you can see here. Then, when you go to Facebook sharing debugger and scrape again the URL, the featured image should be displayed in the preview. I tested this and it worked as expected for me, as you can see here.
Have a nice day!
We already did that (on all of our websites) and all that does is force Facebook and iMessage to use the image that was forced on that setting, not the featured image in posts and pages.
That’s why we already provided the link showing exactly that above:
https://developers.facebook.com/tools/debug/?q=https%3A%2F%2Fnomadicsupply.com%2F
Hi @joyryde!
I checked your site and it seems that the featured image currently set for the site is the one from this link, which is the logo. Please make sure you properly set the desired image as featured image. I tested this and for my test instance the correct image is displayed, as you can see in the screenshots provided in my previous answer, so the issue doesn’t seem to be theme related. I also tested a product page from your site, and that works as expected too – screenshot.
Have a nice day!
Hi, unfortunately that’s not the case. The Feature Image is the Featured Image. The logo is what is set in Rank Math -> Titles & Meta -> OpenGraph Thumbnail because that’s what you said to do.
The Featured Image is what the theme can’t handle correctly.
See here:
https://www.awesomescreenshot.com/image/13796278?key=99d5846bc4ec300f55fcc359628c55ac
I figured it out, it is a failure of the Neve Theme as I’d suspected. Their website provides a workaround:
https://docs.themeisle.com/article/1263-neve-how-to-display-the-featured-image-on-pages
Hi there!
I’m glad to hear you found the workaround for single pages! This is not a failure of Neve, it’s the way the theme works, hence the documentation you pointed at above.
Have a good day!