【发布时间】:2020-12-28 16:50:33
【问题描述】:
我已经为我的 wordpress 网站建立了一个 404 页面。在我的404.php中,我用<?php get_header(); ?> 调用了标头函数。我想用 404 徽标替换我的正常徽标。在我的header.php 中,我添加了以下函数:
<?php
if ( is_404()){
echo "test";
}
else {
echo "test1";
}
?>
仅用于测试我是否可以对 404 页面执行其他操作并且它正在工作。
现在我想为 404 页面替换我的徽标。在这两种情况下,徽标都是svg。
这是header.php的相关部分:
<header class="m-header">
<div class="m-header-content">
<div class="m-header-logo">
<a href="/">
<svg>
<title>test<title>
<path class="st0" d="svgpath....."/>
</svg>
</a>
</div>
<div>
<?php wp_nav_menu( array(
'theme_location' => 'main_menu',
'container_class' => 'm-header-menu') );
?>
</header>
谁能给我一个例子,我如何在顶部更改<svg>?或者有人可以给我一份关于它的文档。
【问题讨论】:
标签: php wordpress function svg header