Hello,
I have a Settings page with a 'image advanced' custom field meant to set the favicon. I followed your guide/s at post 1 and post 2 to create the following code. But its not working.
<?php
function prefix_dynamic_favicon(){
$favicon = rwmb_meta( 'favicon', [ 'object_type' => 'setting' ], 'site-identity' );
$favicon = $favicon ? $favicon['url'] : get_site_icon_url();
echo "<link rel='shortcut icon' href='$favicon' sizes='32x32' type='image/x-icon'>";
}
add_action( 'wp_head', 'prefix_dynamic_favicon' );
Could you please advise a solution here to set the site's favicon using an MB custom field on a settings page?
Kind regards,