当您在某些页面上时,我正在尝试自定义Avada以将主站点徽标链接到自定义URL。 我将logo.php复制到子主题中并添加了以下内容:
<?php $standard_logo = Avada()->images->get_logo_image_srcset( 'logo', 'logo_retina' ); ?>
//Binghamton
if (is_page( array (194, 376, 534, 329, 499, 489, 479, 476, 467)))
{
$standard_logo['srcset'] = '/wp-content/uploads/2018/06/broadway-binghamton-logo.png';
$standard_logo['url'] = $standard_logo['srcset'];
$retina_logo['srcset'] = '/wp-content/uploads/2018/06/broadway-binghamton-logo-retina.png';
$retina_logo['url'] = $standard_logo['srcset'];
}
//Erie
if (is_page( array (248, 382, 589, 926, 1542, 1537, 1514)))
{
$standard_logo['srcset'] = '/wp-content/uploads/2018/06/broadway-erie-logo.png';
$standard_logo['url'] = $standard_logo['srcset'];
$retina_logo['srcset'] = '/wp-content/uploads/2018/06/broadway-erie-logo.png';
$retina_logo['url'] = $standard_logo['srcset'];
}
?>
alt="<?php echo esc_attr( $logo_alt_attribute ); ?>" retina_logo_url="<?php echo esc_url_raw( $standard_logo['is_retina'] ); ?>" class="fusion-standard-logo" />
if ( Avada()->settings->get( 'mobile_logo', 'url' ) && '' !== Avada()->settings->get( 'mobile_logo', 'url' ) ) {
$mobile_logo = Avada()->images->get_logo_image_srcset( 'mobile_logo', 'mobile_logo_retina' );
?>
//Binghamton
if (is_page( array (194, 376, 534, 329, 499, 489, 479, 476, 467)))
{
$mobile_logo['srcset'] = '/wp-content/uploads/2018/06/broadway-binghamton-logo.png';
$mobile_logo['url'] = $mobile_logo['srcset'];
}
//Erie
if (is_page( array (248, 382, 589, 926, 1542, 1537, 1514)))
{
$mobile_logo['srcset'] = '/wp-content/uploads/2018/06/broadway-erie-logo.png';
$mobile_logo['url'] = $mobile_logo['srcset'];
}
?>
alt="<?php echo esc_attr( $logo_alt_attribute ); ?>" retina_logo_url="<?php echo esc_url_raw( $mobile_logo['is_retina'] ); ?>" class="fusion-mobile-logo" />
可以更改徽标以匹配正确的城市,但是我需要将城市徽标链接到城市页面,而不是首页。
我试过了:
$standard_logo['/broadway-in-binghamton/'] = $standard_logo['srcset'];
但我认为那是不对的。 类似的问题说要进入header.php文件并找到您的徽标类,但是此主题不会将其存储在此处。 有没有办法在logo.php文件中插入自定义URL?