Quantcast
Channel: WordPress.org Forums » [Open Graph and Twitter Card Tags] Support
Viewing all articles
Browse latest Browse all 47

Filter fb_og_desc on particular page

$
0
0

Replies: 0

Hi,

I would like to customize output for “fb_og_desc” for particular pages. For example on WP Author page I would like to make it custom and created following code:

function custom_author_meta_description() {

if (is_author()) {
// Get the author object
$author = get_queried_object();

// Get the author's first and last name
$first_name = get_user_meta($author->ID, 'first_name', true);
$last_name = get_user_meta($author->ID, 'last_name', true);

// Static Text
$description_text = "items";

// Combine str template
$new_description = "$first_name $last_name $description_text";

return $new_description;
}
}

add_action('fb_og_desc', 'custom_author_meta_description');




But it doesn’t work. Could you please point out me where is the issue?
Thanks


Viewing all articles
Browse latest Browse all 47

Trending Articles