Skip to content

Instantly share code, notes, and snippets.

@anythinggraphic
Last active August 31, 2017 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anythinggraphic/b1382dcb5e450a472da7510a647a3813 to your computer and use it in GitHub Desktop.
Save anythinggraphic/b1382dcb5e450a472da7510a647a3813 to your computer and use it in GitHub Desktop.
Add custom Facebook Social Share descriptions for Yoast SEO for Archive pages
<?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