Viewing 15 replies - 1 through 15 (of 16 total)
  • are you removing the closing </div> and </header> tags when you remove:

    <div class="entry-background" style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>)"> <header class="entry-header">

    Thread Starter A.Asraf

    (@aasraf)

    @pdg87, I’m not entirely sure what you mean (sorry I’m not good at this stuff). I only remove the codes I paste, which is <div class=”entry-background” style=”background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>)”> <header class=”entry-header”>.

    Please check the edited content-single.php. I uploaded the original one. Thank you for your reply.

    Could you not just remove the following part:

    style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>)"

    Thread Starter A.Asraf

    (@aasraf)

    okay, Im not sure what your css is for each element. Instead try removing:

    <div class="entry-background" style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>)"> <header class="entry-header">.

    and

    </div><!-- .entry-background -->

    Thread Starter A.Asraf

    (@aasraf)

    @pdg87, thank you for fast reply. Removing the parts you list will give the same page as https://dl-2.kraken.io/7ebd885607d976cce9fc5ceee617ce32/FeaImgPost3.png.

    Do you want me to upload anything for your reference?

    Okay, if you change:

    <div class="entry-background" style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>)">
                <header class="entry-header">
                    <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
                </header><!-- .entry-header -->
            </div><!-- .entry-background -->

    to:

    <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>

    Or if there is a direct link to the page live? I could probably help more

    Thread Starter A.Asraf

    (@aasraf)

    @pdg87, did that and same result as above – blank white space.
    What do you mean by direct link to the page live?

    Yep if possible?

    Thread Starter A.Asraf

    (@aasraf)

    @pdg87, as I mentioned earlier I’m not good with this stuff, it’s my first website. With that said, I don’t understand by -direct link to the page live?

    I just meant the URL, but I found it from the image you posted. Do you know css at all? There is a fixed height on the content wrapper to move it down. The title is also set to white in colour. This should work:
    Change:

    <?php
    /**
     * @package Tesseract
     */
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    
    	<?php if ( has_post_thumbnail() && 'post' == get_post_type() ) {
            $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'tesseract-large' ); ?>
            <div class="entry-background" style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>)">
                <header class="entry-header">
                    <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
                </header><!-- .entry-header -->
            </div><!-- .entry-background -->
    
        <?php } else { ?>
            <header class="entry-header">
                <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
            </header><!-- .entry-header -->
        <?php } ?>
    
    	<div class="entry-content">
            <div class="entry-meta">
    	        <?php tesseract_posted_on(); ?>
    		</div><!-- .entry-meta -->
    		<?php the_content(); ?>
    		<?php
    			wp_link_pages( array(
    				'before' => '<div class="page-links">' . __( 'Pages:', 'tesseract' ),
    				'after'  => '</div>',
    			) );
    		?>
    	</div><!-- .entry-content -->
    
    </article><!-- #post-## -->

    to:

    <?php
    /**
     * @package Tesseract
     */
    ?>
    
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    
    	<?php if ( has_post_thumbnail() && 'post' == get_post_type() ) {
            $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'tesseract-large' ); ?>
    <header class="entry-header">
    <?php the_title( '<h1 class="entry-title-single">', '</h1>' ); ?>
    </header><!-- .entry-header -->
        <?php } else { ?>
            <header class="entry-header">
                <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
            </header><!-- .entry-header -->
        <?php } ?>
    
    	<div class="entry-content-single">
            <div class="entry-meta">
    	        <?php tesseract_posted_on(); ?>
    		</div><!-- .entry-meta -->
    		<?php the_content(); ?>
    		<?php
    			wp_link_pages( array(
    				'before' => '<div class="page-links">' . __( 'Pages:', 'tesseract' ),
    				'after'  => '</div>',
    			) );
    		?>
    	</div><!-- .entry-content -->
    
    </article><!-- #post-## -->

    The code needs cleaning up really there is if statement where I dont think its needed (my php is poor)

    you should really add styles to the new title class .entry-title-single

    a quick and dirty inline fix if you want it the same style as other pages just a different colour:

    change

    <?php the_title( '<h1 class="entry-title-single">', '</h1>' ); ?>

    to
    <?php the_title( '<h1 style="color: #000;" class="entry-title">', '</h1>' ); ?>

    Thread Starter A.Asraf

    (@aasraf)

    @pdg87, to answer your question, no I don’t know any of it. As I said, this is my first website and I started with zero knowledge building it. What you can see on my website right now is the result of me googling and youtubing any information I can find to make it happen.

    To answer your latest reply, it works!! I don’t exactly understand what changes you made to the codes, but it works as I want it to be. Thank you so much! I have been working on this problem since yesterday to no avail until I decided to post it here and you came by. Really, thank you, no, THANK YOU! God bless you man.

    To other Tesseract theme user you can check on this solution to remove Featured Image on your post for your blog page.

    No probs man, hopefully it doesnt cause any layout issues on other parts of the site. Its a little hacky, I’ll write up some cleaner code if I get a second.

    I basically just renamed a few elements to remove the default styles/layout (CSS) that was being applied to them to work with the feature image ??

    Thread Starter A.Asraf

    (@aasraf)

    @pdg87, hopefully nothing major. But I noticed something odd in my single-post page. It seems like the post title now is little bit off to the right.
    https://dl-2.kraken.io/ccff2ce396e66f70a9f19dae3f21fe97/FeaImgPost5.png

    I don’t mind this as I can easily hide the title (I have Title Remover plugin installed) and use post heading (Heading 1) instead. Other than that, all seems to work just fine- and I hope it stays that way. Should be fine right?

    Currently my blog is still under development, should be complete by this Friday. I will update here if find anything odd. Again, thank you so much.

    A. Asraf

    Hey, no problem, Its just some margin gettin applied still to the header element.

    If you change:

    <header class="entry-header">
    <header class="entry-header-single">

    It should work.

    Basically just changing the element class names adding ‘-single’ this way it doesn not pick up any styling from the other page elements and we could style these elements differently if needed.

    This wont cause any layout problems. Just if you ever want an post to include the large header image. You would have to set up a custom template for certain posts to acheive this.

    These changes will show on every post. So the layout will be like this.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Unable to remove Featured Image in Post page.’ is closed to new replies.