Thanks.
I’ve gotten myself a bit stuck, I am trying to self teach myself this and maybe you can kick me in the right direction – I am currently headbutting the keyboard trying to figure out what.
I’ve created some new user meta field via acf to capture what a author knows about
They have ACF slugs as author_knowabout, author_knowabout2, author_knowabout3, author_knowabout4, author_knowabout5.
To turn these into WP variable, I have used your rank_math/vars/register_extra_replacements funtion
add_action('rank_math/vars/register_extra_replacements', function () {
rank_math_register_var_replacement(
'knowsabout',
[
'name' => esc_html__('Author Knowns About', 'rank-math'),
'description' => esc_html__('Author Knowns About Info', 'rank-math'),
'variable' => 'knowsabout',
'example' => knowabout_callback(),
],
'knowabout_callback'
);
});
function knowabout_callback() {
global $post;
$author_id = $post->post_author;
$author_info1 = get_field('author_knowabout', 'user_'. $author_id );
$author_info2 = get_field('author_knowabout_2', 'user_'. $author_id );
$author_info3 = get_field('author_knowabout_3', 'user_'. $author_id );
$author_info4 = get_field('author_knowabout_4', 'user_'. $author_id );
$author_info5 = get_field('author_knowabout_5', 'user_'. $author_id );
$author_info = $author_info1;
if (isset($author_info2)) {
$author_info = $author_info . ', ' . $author_info2;
}
if (isset($author_info3)) {
$author_info = $author_info . ', ' . $author_info3;
}
if (isset($author_info4)) {
$author_info = $author_info . ', ' . $author_info4;
}
if (isset($author_info5)) {
$author_info = $author_info . ', ' . $author_info5;
}
return $author_info;
}
I have then created a custom schema called knowsabout, as per the screenshot below
https://share.getcloudapp.com/yAu9NNwA
This is set with insert > custom > Person as the display rules
Where have i taken a wrong turn or have a had a full on Britney melt down?
All help welcomed