Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 什么在阻止我的标题图像加载_Php_Css_Wordpress_Header - Fatal编程技术网

Php 什么在阻止我的标题图像加载

Php 什么在阻止我的标题图像加载,php,css,wordpress,header,Php,Css,Wordpress,Header,我已经有一段时间看不到标题图像了。我尝试为移动设备和非移动设备分别设置标题。我曾经使用过这段代码(现在我已经使用/**/将其放在注释中) 我试着恢复到更简单的方式,只做自定义->标题图像和选择标题的方式。这也不管用了 看起来我的引导代码有问题,我对引导非常不熟悉,但有人建议我使用它 我的网站是www.rostheexplorer.com 当设备宽度大于601px时,我希望发生以下情况 我不希望菜单和菜单之间有任何空隙 自定义标题 我不想在地面上有任何空间 客户标题 我不希望H1、插件或页面上的

我已经有一段时间看不到标题图像了。我尝试为移动设备和非移动设备分别设置标题。我曾经使用过这段代码(现在我已经使用/**/将其放在注释中)

我试着恢复到更简单的方式,只做自定义->标题图像和选择标题的方式。这也不管用了

看起来我的引导代码有问题,我对引导非常不熟悉,但有人建议我使用它

我的网站是www.rostheexplorer.com

当设备宽度大于601px时,我希望发生以下情况

  • 我不希望菜单和菜单之间有任何空隙 自定义标题
  • 我不想在地面上有任何空间 客户标题
  • 我不希望H1、插件或页面上的任何其他内容与客户标题重叠
  • 我不希望在客户标题的左侧或右侧出现任何空白
  • 我想一直都能看到《探险家罗斯》的全文 不想删除最后一个R
在header.php中,我

<?php wp_head(); ?>

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>


</head>

我试图删除下面的代码,看看这是否会有所不同,但我的头仍然没有加载

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>


有人能提个建议吗

我会将此作为评论发布,但我还不能发布评论

无法查看图像的原因是您将其设置为
div
的背景,而不是实际的html对象

为了查看该
div
的背景,它需要定义一个
高度

您的
.custom标头
div
具有指定的
宽度
1500px
,但没有指定的
高度,这就是您无法看到它的原因

有很多方法可以解决这个问题,但是由于你对你的标题很明确,我建议你只把标题本身作为一个图像添加进去

<img src="https://i2.wp.com/www.rosstheexplorer.com/wp-content/uploads/2017/05/Cover-Photo-Mobile-Test.jpg">

我会将此作为评论发布,但我还不能发布评论

无法查看图像的原因是您将其设置为
div
的背景,而不是实际的html对象

为了查看该
div
的背景,它需要定义一个
高度

您的
.custom标头
div
具有指定的
宽度
1500px
,但没有指定的
高度,这就是您无法看到它的原因

有很多方法可以解决这个问题,但是由于你对你的标题很明确,我建议你只把标题本身作为一个图像添加进去

<img src="https://i2.wp.com/www.rosstheexplorer.com/wp-content/uploads/2017/05/Cover-Photo-Mobile-Test.jpg">

我现在已经解决了这个问题。谢谢大家的帮助

我有两个标题图像,一个用于移动设备。我在header.php和其他CSS中有与标题图像相关的代码

在header.php中,代码是

<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
    <a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'penscratch' ); ?></a>


<img class="header-img" src="https://i2.wp.com/www.rosstheexplorer.com/wp-content/uploads/2017/02/Cover-Photo-6-2.jpg">


<img class="mobile-header-img" src="https://i2.wp.com/www.rosstheexplorer.com/wp-content/uploads/2017/05/Cover-Photo-Mobile-Test.jpg">
@media screen and (min-width: 661px) {
    .mobile-header-img {
        display: none;
        width: 100%;
    }
}

@media screen and (max-width: 660px) {
    .header-img {
        display: none;
    }
}

我现在的问题是让标题延伸到整个页面。您可以在这里阅读有关该问题的信息。

我现在已对该问题进行了排序。谢谢大家的帮助

我有两个标题图像,一个用于移动设备。我在header.php和其他CSS中有与标题图像相关的代码

在header.php中,代码是

<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
    <a class="skip-link screen-reader-text" href="#content"><?php _e( 'Skip to content', 'penscratch' ); ?></a>


<img class="header-img" src="https://i2.wp.com/www.rosstheexplorer.com/wp-content/uploads/2017/02/Cover-Photo-6-2.jpg">


<img class="mobile-header-img" src="https://i2.wp.com/www.rosstheexplorer.com/wp-content/uploads/2017/05/Cover-Photo-Mobile-Test.jpg">
@media screen and (min-width: 661px) {
    .mobile-header-img {
        display: none;
        width: 100%;
    }
}

@media screen and (max-width: 660px) {
    .header-img {
        display: none;
    }
}

我现在的问题是让标题延伸到整个页面。您可以在此处阅读该问题。

值得注意的是,您应该在header.php文件中使用wp_排队来显示脚本和样式,而不是标记。值得注意的是,您应该在header.php文件中使用wp_排队来显示脚本和样式。谢谢,现在我的问题是如何将媒体查询合并到header.php中。我在这里讨论这个问题-您可以将类添加到img标记以实现这一点。检查上面的更新谢谢,现在我的问题是如何将媒体查询合并到header.php中。我在这里讨论这个问题-您可以将类添加到img标记以实现这一点。检查上面的更新