【问题标题】:Image in header not show when go to another page in wordpress转到wordpress中的另一个页面时,标题中的图像不显示
【发布时间】:2019-03-26 04:24:36
【问题描述】:

我的标题主页有带有 site_url 的徽标图像,但是当我移动到另一个页面时,带有图像的标题是错误的,但链接仍然有效。我检查了显示图像链接为“xxx.local/xx.png”的 Inspect 主页,但我在另一个显示图像链接为 xxx.local/about/xx.png 的页面中检查了 Inspect。

<nav>
  <a class="school-logo-text float-left"><a href="<?php echo site_url() ?>"><img src="xxx.png" style="width:`enter code here`215px;height:141px;></a></a>
      </nav>

【问题讨论】:

    标签: php html wordpress


    【解决方案1】:

    将此代码添加到您的函数文件中。

    register_default_headers( array(
    'default-image' => array(
        'url'           => get_stylesheet_directory_uri() . '/assets/img/default-header.jpg',
        'thumbnail_url' => get_stylesheet_directory_uri() . '/assets/img/default-header.jpg',
        'description'   => __( 'Default Header Image', 'textdomain' )
    ),
    ) );
    

    尝试上传您的图片。 有关更多详细信息,请参阅此https://codex.wordpress.org/Function_Reference/register_default_headers

    【讨论】:

    • 它可以工作,但这是您发送给我的链接中的另一个代码。无论如何,非常感谢
    • 链接仅供参考
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-06
    • 2020-02-14
    • 1970-01-01
    • 2015-11-29
    • 1970-01-01
    相关资源
    最近更新 更多