Filter fb_og_desc on particular page
-
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 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.