Last active
August 31, 2017 22:05
-
-
Save anythinggraphic/b1382dcb5e450a472da7510a647a3813 to your computer and use it in GitHub Desktop.
Add custom Facebook Social Share descriptions for Yoast SEO for Archive pages
This file contains 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
<?php | |
/* @link https://anythinggraphic.net/yoast-seo-add-custom-social-share-images-for-archive-category-pages-in-wordpress | |
/* Add custom Facebook Social Share descriptions for Yoast SEO for Archive pages | |
----------------------------------------------------------------------------------------*/ | |
add_filter( 'wpseo_opengraph_desc', 'ag_yoast_seo_fb_share_descriptions' ); | |
function ag_yoast_seo_fb_share_descriptions( $desc ) { | |
if( is_post_type_archive( 'posttypename' ) ) { | |
$desc = 'Design and development projects by Anything Graphic.'; | |
} | |
if( is_category( 'categoryname' ) ) { | |
$desc = 'Design and development projects by Anything Graphic.'; | |
} | |
return $desc; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment