Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Small notice thrown in some scenarios

$
0
0

Replies: 0

A small notice is thrown sometimes by the file header.php in some scenarios.

For example, when trying to create a child theme with Child Theme Configurator, I get a notice like this:

Notice: Trying to get property of non-object in /home/xxxxx/public_html/wp-content/themes/lovecraft/header.php on line 143

The lines from 141-143 show the next:
$header_image = get_header_image();
$header_image_data = get_theme_mod( ‘header_image_data’ );
$header_image_alt = get_post_meta( $header_image_data->attachment_id, ‘_wp_attachment_image_alt’, true );

What makes me then think that sometimes get_theme_mod does not get all the information it needs.

While this does not breaks anything, I noticed this while creating a child theme for this theme. So may make some people wonder.

Thanks for reading.


Viewing all articles
Browse latest Browse all 59525

Trending Articles