• Resolved melton51

    (@melton51)


    We have a specific application that requires a NAME meta attribute written on output. How does one add custom attributes in SEO Framework, or do we need to create these in the Theme as a redundant tag (and would that create problems with your plugin?)

    Current output:
    <meta property=”og:image” content=”[Image URL here]”>

    Needed output:
    <meta property=”og:image” name=”image” content=”[Image URL here]”>

    Appreciate any insight you may have. Great plugin by the way. We love it.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    I had your use-case in mind last year during a rewrite of our metatags, but I didn’t have the time to implement it.

    So, I’m afraid this currently isn’t possible. It’d be best to create an extra tag with the name attribute, but then I don’t recommend setting it with the property og:image, as Facebook will allow users to select the image twice when sharing.

    With all that, I recommend using this snippet:

    add_action( 'wp_head', function() {
    
    	if ( function_exists( 'the_seo_framework' ) ) {
    		$image_details = current( the_seo_framework()->get_image_details_from_cache() );
    	}
    
    	$image_url = isset( $image_details['url'] ) ? $image_details['url'] : '';
    
    	if ( $image_url ) {
    		printf(
    			'<meta name="image" content="%s" />' . PHP_EOL,
    			esc_attr( $image_url )
    		);
    	}
    }, 1 );
    

    Feel free to manage the snippet however you’d like ?? Cheers!

Viewing 1 replies (of 1 total)
  • The topic ‘Adding a meta name in output of Social data’ is closed to new replies.