Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Share image for articulo
- add_filter('wpseo_opengraph_image', 'social_image_articulo');
- function social_image_articulo($image) {
- global $post;
- if( is_singular( ['articulo'] ) ){
- $image = get_post_meta($post->ID, 'wpcf-imagen-full', true);
- }
- return $image;
- }
- // Share image for columnista
- add_filter('wpseo_opengraph_image', 'social_image_columnista');
- function social_image_columnista($image) {
- global $post;
- if( is_singular( ['columnista'] ) ){
- $image = get_post_meta($post->ID, 'wpcf-foto-del-columnista', true);
- }
- return $image;
- }
- // Share image for blogger
- add_filter('wpseo_opengraph_image', 'social_image_blogger');
- function social_image_blogger($image) {
- global $post;
- if( is_singular( ['blogger'] ) ){
- $image = get_post_meta($post->ID, 'wpcf-foto-del-blogger', true);
- }
- return $image;
- }
- // Share image for debate
- add_filter('wpseo_opengraph_image', 'social_image_debate');
- function social_image_debate($image) {
- global $post;
- if( is_singular( ['debate'] ) ){
- $image = get_post_meta($post->ID, 'wpcf-foto-del-ponente-a-favor', true);
- }
- return $image;
- }
Add Comment
Please, Sign In to add comment