Background image is not showing up; just showing white

Hey. I’ve placed a background image into this post, and it shows for a second, then goes back to the standard white. Any way to fix this?

https://peterfae.intothemythica.com/2003/08/21/2003-8-21-the-haven-of-ravens/

As in, the paper-texture that is shown behind the sidebar should be across the whole post

Hello Peter,

Thanks for writing in! Please be advised that in Ethos stack, there is a default white background that covers the content area which is why the background image behind it will not be display. If you want to display the background image and get rid of the white background around the content, please add the following CSS code in the X > Theme Options > Global CSS (http://prntscr.com/evui3r)

.single-post .x-container.main:before {
    display: none;
}

And then you will have this layout:

Hope this helps.

I’m going to try that. How to set it for a specific category or set of categories yet leave it for others?

Hello Peter,

How to set it for a specific category or set of categories yet leave it for others?

  • Before you can do that, you will need to modify the body class of each post. To add category class in your post, you can add the code below in your child theme’s functions.php file:
add_filter('body_class','add_category_to_single');
  function add_category_to_single($classes) {
    if (is_single() ) {
      global $post;
      foreach((get_the_category($post->ID)) as $category) {
        // add category slug to the $classes array
        $classes[] = "mycategory-".$category->category_nicename;
      }
    }
    // return the $classes array
    return $classes;
  }

Please note that I added mycategory- prefix to prevent conflict. So the class will be mycategory-category-name and in the custom css, you can have something like this:

.single-post.mycategory-category-name .x-container.main:before {
    display: none;
}

Please note that custom coding is outside the scope of our support. Issues that might arise from the use of custom code and further enhancements should be directed to a third party developer.

Hope this helps. Please let us know how it goes.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.