• I am looking to remove the featured image when viewing a post on my blog at freewillracing.com. I am using the Magnus theme and the fixes I have found online have not proven to help just yet! I’ve also tried using the Hide Featured Image plugin to no avail. I want the featured images to show on the main page of the blog but I do not want them to show when viewing a post. I find it confusing as an end user when clicking the post and then seeing the image flash and not being 100% certain whether you need to scroll down or not to read the rest of the article.

Viewing 1 replies (of 1 total)
  • Damon Cook

    (@colorful-tones)

    You can accomplish this one of two ways, depending on how comfortable you are editing theme files or CSS.

    1) Quick-and-easy: Add CSS to hide the feature image area on single posts. This code should work:

    .single-post .site-header-image {
        display: none;
    }

    2) More labor intensive, but still not hard: Create a child theme (best practice and in case the theme updates), and copy over the header.php file and modify so that the following existing code:

    <?php if (is_home()) : ?>
    
    	<section id="content" class="blog-home-content">
    
    	<?php else : ?>
    	<section class="site-header-image">
    		<?php // Check if this is a post or page, if it has a thumbnail, and if it's a big one
    		if ( is_singular() && has_post_thumbnail(  get_the_ID() ) ) :
    			// Houston, we have a new header image!
    			//echo get_the_post_thumbnail( $post->ID, 'magnus-large' );
    
    			$image_id = get_post_thumbnail_id();
    			$url = wp_get_attachment_image_src( $image_id, 'magnus-large' ); ?>
    
    			<div class="section-image" style="background-image: url(<?php echo esc_attr( $url[0] ); ?>);">
    			</div><!-- .section-image -->
    
    		<?php elseif ( get_header_image() ) : ?>
    			<img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />
    		<?php endif; // end check for featured image or standard header ?>
    	</section><!-- .site-header-image -->
    
    	<section id="content" class="site-content">
    <?php endif; // end check for blog homepage ?>

    Gets changed to this:

    <?php if (is_home()) : ?>
    
    	<section id="content" class="blog-home-content">
    
    	<?php else : ?>
    
    	<section id="content" class="site-content">
    
    <?php endif; // end check for blog homepage ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Remove Featured Image- Magnus Theme’ is closed to new replies.