Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter mori42

    (@mori42)

    I will mark this resolved

    Thread Starter mori42

    (@mori42)

    Thank 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,
    Moira

    Thread Starter mori42

    (@mori42)

    Hello 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.

    Thread Starter mori42

    (@mori42)

    this 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;
      }
    Thread Starter mori42

    (@mori42)

    Meanwhile my blog went live, you find it here:

    https://blog.moirarisenprints.com/

Viewing 5 replies - 1 through 5 (of 5 total)