V
V
VladPro2020-05-17 13:58:26
PHP
VladPro, 2020-05-17 13:58:26

Need help can't change the background of a part of the header?

I found this code:
There is a section in the admin panel where you can replace the image, but for some reason, in order not to set the standard, I think there is an error in the code .... or the theme developers are naughty.
// Get image url.
$image_url = get_header_image();

if ( is_singular() && has_post_thumbnail() ) {
$image_url = get_the_post_thumbnail_url( null, 'ht_cover_large' );
} elseif ( ht\is_plugin_active( 'hivepress' ) && is_tax( 'hp_listing_category' ) ) {
$image_id = get_term_meta( get_queried_object_id(), 'hp_image', true );

if ( $image_id ) {
$image = wp_get_attachment_image_src( $image_id, 'ht_cover_large' );

}
}
}

// Add inline style.
if ( $image_url ) {
$style = '.header-hero { background-image: url(' . esc_url( $image_url ) . '); }';

if ( get_header_textcolor() ) {
$style .= '.header-hero { color: #' . esc_attr( get_header_textcolor() ) . '; }';
}

wp_add_inline_style( 'hivetheme-core-frontend', $style );
}
}

here is the css code




Find a place to call home.

Handpicked houses, apartments and rooms for long-term rent.



Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question