avada 修改head.php,php - 使用WordPress Avada子主题将主徽标链接到自定义URL而不是首页? - 堆栈内存溢出...
當(dāng)您在某些頁面上時,我正在嘗試自定義Avada以將主站點徽標(biāo)鏈接到自定義URL。 我將logo.php復(fù)制到子主題中并添加了以下內(nèi)容:
<?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" />
可以更改徽標(biāo)以匹配正確的城市,但是我需要將城市徽標(biāo)鏈接到城市頁面,而不是首頁。
我試過了:
$standard_logo['/broadway-in-binghamton/'] = $standard_logo['srcset'];
但我認(rèn)為那是不對的。 類似的問題說要進(jìn)入header.php文件并找到您的徽標(biāo)類,但是此主題不會將其存儲在此處。 有沒有辦法在logo.php文件中插入自定義URL?
總結(jié)
以上是生活随笔為你收集整理的avada 修改head.php,php - 使用WordPress Avada子主题将主徽标链接到自定义URL而不是首页? - 堆栈内存溢出...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 万字长文讲解编码知识,看这文就够了!
- 下一篇: 中小型会议如何进行数字化升级?