og title avada
[vc_row][vc_column][vc_column_text]I have recently had a problem where the link box shown in Facebook is not what I want and is not what I specified in the before head section in Avada -> Theme Options -> General -> Before Head.

The problem is that Avada has in the file functions.php some code that automatically gets values for og:title and og:descrition. To stop this you have to go to the functions.php file and remove this code. Make sure you have a backup first. (In my version of Avada (3.8.4) this starts on line 1111.)

// Adding the Open Graph in the Language Attributes
if( ! $smof_data[‘status_opengraph’] ) {
function add_opengraph_doctype( $output ) {
return $output . ‘ prefix=”og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#”‘;
}
add_filter(‘language_attributes’, ‘add_opengraph_doctype’);

function fusion_insert_og_meta() {
global $smof_data, $post;

if ( !is_singular() )
return;

echo sprintf( ‘<meta property=”og:title” content=”%s”/>’, strip_tags( str_replace( array( ‘”‘, “‘” ), array( ‘&quot;’, ‘&#39;’ ), $post->post_title ) ) );
echo ‘<meta property=”og:type” content=”article”/>’;
echo sprintf( ‘<meta property=”og:url” content=”%s”/>’, get_permalink() );
echo sprintf( ‘<meta property=”og:site_name” content=”%s”/>’, get_bloginfo(‘name’) );
echo sprintf( ‘<meta property=”og:description” content=”%s”/>’, avada_get_content_stripped_and_excerpted( 55, $post->post_content ) );
if( ! has_post_thumbnail( $post->ID ) ) {
if( $smof_data[‘logo’] ) {
echo sprintf( ‘<meta property=”og:image” content=”%s”/>’, $smof_data[‘logo’] );
}
} else {
$thumbnail_src = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), ‘full’ );
echo sprintf( ‘<meta property=”og:image” content=”%s”/>’, esc_attr( $thumbnail_src[0] ) );
}
}
add_action( ‘wp_head’, ‘fusion_insert_og_meta’, 5 );
}

 

 

[/vc_column_text][/vc_column][/vc_row]