Overwrite content of description meta with yoast
-
I’m attempting to overwrite the open protocol og:description with the current yoast meta using the filter open_graph_protocol_meta. I keep getting an error message. Could you please advise on the correct usage of the filter please.
Here’s my current code:
‘function override_description_OGP($content,og:description) {
$ai_yoast_description = get_post_meta( get_the_ID(),’_yoast_wpseo_metadesc’ );
$content = $ai_yoast_description[0];
return $content;
}
add_action(‘open_graph_protocol_meta’, ‘override_description_OGP’);’Getting the following error:
Parse error: syntax error, unexpected ‘:’, expecting ‘&’ or T_VARIABLE in /nas/wp/www/staging/newfifteen40/wp-content/themes/new-Divi-chlid/functions.php on line 47
This is referencing the function override_description_OGP($content,og:description) {
section of the code.I’ve also tried putting og:description as a string ‘og:description’ in the parameters. This didn’t work either.
https://www.ads-software.com/plugins/open-graph-protocol-framework/
- The topic ‘Overwrite content of description meta with yoast’ is closed to new replies.