Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change Open Graph image URLs in Yoast SEO for categories + Taxonomy Images plugin */
add_filter( 'wpseo_opengraph_image', 'change_opengraph_image_url' );
function change_opengraph_image_url( $url ) {
$image_url = apply_filters( 'taxonomy-images-queried-term-image-url', '' );
if (is_category() && $image_url) {
return $image_url;
} else {
return $url;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.