mori42
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Fifty50] Set featured image as header imageI will mark this resolved
Forum: Themes and Templates
In reply to: [Fifty50] Set featured image as header imageThank you for checking – I think then I’ll leave it as it is, and will be careful with theme updates.
Thank you very much,
and all the best to you,
MoiraForum: Themes and Templates
In reply to: [Fifty50] Set featured image as header imageHello Andre,
thanks for your reply. I checked the Rough Pixels page so I was aware of the ownership changes, it’s fully understandable that you are very busy with other things, so I haven’t expected a quick answer :).
Anyway, my wording wasn’t accurate: what I meant was that I’d like to set for each post the post’s featured image, so the side column image would change on each single post page.
Meanwhile, I experimented a bit – if you check my blog https://blog.moirarisenprints.com/ you can see the result. I actually managed to solve it, but what I did is ugly :(…
I wasn’t able to make it work through the functions.php, so I modified the original template-functions.php adding a line for the single posts to the
function custom_background_cb// background is the custom image or the default image if ( is_single() ) { $background_image_url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); } else $background_image_url = set_url_scheme(get_background_image()); // When using a sidecolumn background colour without an image $colour = get_background_color();
I’m sure it can be done properly with the functions. php, maybe I should remove the original function and add it back with the modifications?
I thought – as the site is working for now as I want it ?? – I will rather wait for your answer.
Forum: Themes and Templates
In reply to: [Fifty50] Set featured image as header imagethis is what I tried in the functions.php (child-theme) but it doesn’t do anything
add_action('wp_head', 'featured_custom_background_cb'); function featured_custom_background_cb() { if ( is_single() ) { $background_image_url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); } return $background_image_url; }
Forum: Themes and Templates
In reply to: [Fifty50] Set featured image as header imageMeanwhile my blog went live, you find it here: