• Resolved boogieboa

    (@boogieboa)


    This is a great theme, but the biggest issues:

    1. I don’t want a featured image to appear at the top of each post. How do you remove them site-wide?

    2. How do you make the theme Woocommerce compatible?

    Any advice would be greatly appreciated.

    Cheers

Viewing 3 replies - 1 through 3 (of 3 total)
  • If you just want it removed for some posts, but not all, you simply remove it in each post. If you want to remove it all togehter, but maybe want it back later, you can add this code in the style.css:

    .header-image {
    max-height: 0px;
    }

    The header image is otherwise 400px max height. This means that the image is still there, but not displaying anymore. If you want it back later, you can simply remove this code.

    Remember to add this in your child theme, and not the main theme, otherwise the code will disappear when your main theme is being updatet.

    Thread Starter boogieboa

    (@boogieboa)

    Thank you, but now quite what I was after. This refers to the header and I’m interested in the feature image.

    In functions.php is a pice of code that adds an extra class if there’s featured image:

    // Add body class if is_single and has_featured_image
    add_filter('body_class','lovecraft_is_single_featured_image');
    
    function lovecraft_is_single_featured_image( $classes ){
    
        if ( is_single() && has_post_thumbnail() ){
            $classes[] = 'has-featured-image';
        }
    
        return $classes;
    }

    So you can also add the class ‘has-featured-image’ to your style. You have to figure out the exact style by yourself. I’m using the PC Custom CSS plugin to add some custom CSS.

    But… the featured image is only shown in the header, so why not delete it in the post???

    EDIT: if you use CSS to hide the image, there will be no header as well which looks crappy, so you have to use something like this:

    .has-featured-image div.header-image{
    background-image: url(“https://domain.com/images/image.jpg”) !important;
    }

    This only works with posts, not pages since the them only adds that .has-featured-image class to posts!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Removing Features Images from Single Posts & Homepage’ is closed to new replies.