• Resolved alexiskruizwordpress

    (@alexiskruizwordpress)


    Hi, so I have been trying to research and remove codes to try and get this to work.

    I am looking to remove feature image from my posts, BUT still keep them on the “main page” of my posts. (Or so they still show up when you click on a post, but not when you read the post) Hopefully that makes sense.

    Here is my file for single.php or Single Post

    <?php
    /**
     * The Template for displaying all single posts.
     *
     * @package aThemes
     */
    
    get_header();
    ?>
    
    	<div id="primary" class="content-area">
    		<div id="content" class="site-content" role="main">
    
    		<?php while ( have_posts() ) : the_post(); ?>
    
    			<?php get_template_part( 'content', 'single' ); ?>
    
    			<?php if ( get_theme_mod( 'author_bio' ) != 1 ) : ?>
    				<div class="clearfix author-info">
    					<div class="author-photo"><?php echo get_avatar( get_the_author_meta( 'ID' ) , 75 ); ?></div>
    					<div class="author-content">
    						<h3><?php the_author(); ?></h3>
    						<p><?php the_author_meta( 'description' ); ?></p>
    						<div class="author-links">
    							<a href="<?php echo esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="me">More Posts</a>
    
    							<?php if ( get_the_author_meta( 'twitter' ) ) : ?>
    							<a href="https://twitter.com/<?php echo get_the_author_meta( 'twitter' ); ?>">Twitter</a>
    							<?php endif; ?>
    <code></code>

    Please help me do this, the template I am using is Fashionista if that helps any.

    Nevermind just found the simplest answer. For all those who may be trying to do this, just add this to your custom css file

    .single-post .attachment-post-thumbnail {
        display: none;
    }
Viewing 1 replies (of 1 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Also depending on how the theme is coded you can create a child theme and use a conditional so it only shows up on the front page.

    if ( is_front_page() || is_home() ) {
        the_post_thumbnail();
    }

    Keep in mind that the theme does have to use the_post_thumbnail. There are some that like to recreate the wheel. ??

    PS. Don’t forget to mark as resolved. ??

Viewing 1 replies (of 1 total)
  • The topic ‘How to Remove Featured Image from Posts’ is closed to new replies.