在PHP中查找DIV WordPress的

时间:2015-07-26 08:10:19

标签: php html css wordpress

我正在试图找出,下面存在哪个php文件。 原因,href对logo1.png不起作用。在我的下面的代码中。

<div class="site-branding">
<h1 class="site-title"><a href="http://ironware.in/" rel="home">IRONWARE</a></h1>
<p class="site-description">Home Products..</p>
</div>

样式表:

.site-branding {
    content: url("http://ironware.in/wp-content/uploads/2015/07/Logo1.png");
    width: 35% !important;

现在通过浏览器&gt;查找右键单击&gt;检查元素&gt;哪个PHP存在?

1 个答案:

答案 0 :(得分:0)

我通过将以下内容添加到我的孩子主题的header.php

中找到了解决方案
add_action( 'init', 'storefront_custom_logo' );
function storefront_custom_logo() {
    remove_action( 'storefront_header', 'storefront_site_branding', 20 );
    add_action( 'storefront_header', 'storefront_display_custom_logo', 20 );
}

function storefront_display_custom_logo() {
?>
    <a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="site-logo-link" rel="home">
        <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/logo.png" alt="<?php echo get_bloginfo( 'name' ); ?>" />
    </a>
<?php
}