简体   繁体   中英

Wordpress Header Background Image Issue

After hours of trying different things and codes, I came here to seek some help (I'm beginner in coding).

I'd like to put a full width and full height background image only in the header. The site is here: http://www.coveragenewstv.com/

Here is header.php :

<head>
<title><?php wp_title('|', true, 'right'); ?></title>
<meta charset="<?php bloginfo( 'charset' );?>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
wp_head(); /** we hook up in wp_booster @see td_wp_booster_functions::hook_wp_head */
?>
</head>

<body <?php body_class() ?> itemscope="itemscope" itemtype="<?php echo td_global::$http_or_https?>://schema.org/WebPage">

<?php //this is closing in the footer.php file ?>

<?php /* scroll to top */?>
<div class="td-scroll-up"><i class="td-icon-menu-up"></i></div>

<div id="td-outer-wrap">

<div class="td-transition-content-and-menu td-mobile-nav-wrap">
    <?php locate_template('parts/menu-mobile.php', true);?>
</div>

<?php //this is closing in the footer.php file ?>
<div class="td-transition-content-and-menu td-content-wrap">

<?php
td_api_header_style::_helper_show_header();

do_action('td_wp_booster_after_header'); //used by unique articles

Add two code-blocks to the bottom of your css file:

.td-banner-wrap-full, .td-header-menu-wrap-full {
    background-color: transparent;
}

and

.td-header-wrap.td-header-style-1 {
    background-image: url(http://www.joomlaworks.net/images/demos/galleries/abstract/7.jpg);
    background-size: cover;
}

Replace the url to your background image url.

See: Works fine

pls make sure that it dont make sense to change anything in the header.php. The header.php dont belongs to the site header, it is more like a config for wordpress.

If you like to change the Header-Background just go in your wordpress admin section and change it over there.

You can find the admin section under

http://www.coveragenewstv.com/wp-login.php

There you got to My Sites in the Admin Bar and click on customize. There needs to be a section called 'Header Image Section'. You need to upload your background and this should work fine.

Greats, Traxstar!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM