Created
September 30, 2016 01:16
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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