Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function company_banner_to_og_image( $image ) {
- global $post;
- if ( is_singular( 'company' ) ) {
- $image_sizes = get_field( 'banner', $post->ID );
- $image = $image_sizes['sizes']['large'];
- }
- return $image;
- }
- add_filter( 'wpseo_opengraph_image', 'company_banner_to_og_image' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement