我想根据当前用户的用户角色来更改徽标。
在flatsome-child文件夹中,我已经访问了functions.php。
仅尝试更改徽标是行不通的,所以我尝试了一些代码,给了我nada更改。
我已经搜索了如何更改自定义徽标,但是我发现的是如何在Wordpress中进行更改,但是我需要根据用户角色使用两个不同的徽标。
<?
add_filter('get_custom_logo','helpwp_custom_logo_output',10);
function helpwp_custom_logo_output() {
$html = '<a href="https://www.linkhere.com/" title="linkhere.com" rel="home">';
$html .= '<img width="278" height="73" src="https://www.linkhere.com/wp-content/uploads/2019/11/linkhere-logo-custom.png" class="header_logo header-logo" alt="linkhere" scale="0">';
$html .= '<img width="278" height="73" src="https://www.linkhere.com/wp-content/uploads/2019/11/linkhere-logo-custom.png" class="header-logo-dark" alt="linkhere" scale="0">';
$html .= '</a>';
$html = str_replace('header_logo','logo',$html );
return $html;
}
?>