Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save agarwa13/523f1439ca17b44a21dcf5ddd1dadbb9 to your computer and use it in GitHub Desktop.
Save agarwa13/523f1439ca17b44a21dcf5ddd1dadbb9 to your computer and use it in GitHub Desktop.
Solution for Pinterest and Facebook Open Graph Incompatibility on Article Author Meta Tag
if ( stripos( $_SERVER['HTTP_USER_AGENT'], 'Pinterest' ) !== false ) {
echo '<meta property="article:author" content="' . esc_attr( $author ) . '"/>' . "n";
} elseif ( !empty( $author_facebook ) ) {
echo '<meta property="article:author" content="http://www.facebook.com/' . esc_attr( $author_facebook ) . '"/>' . "n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment