• Resolved chadp

    (@chadp)


    I’d like it so that my featured image is centered once you enter the actual post.

    How do I fix that?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter chadp

    (@chadp)

    figured it out..

    located the <div> tag and put an align=”center” into it.

    nebelwerfer

    (@nebelwerfer)

    i have the same problem and i did not manage to solve it. care to help out?

    edit: fyi, i can “resolve” it by adding align=”center” within the <img> tag, but that’s not exactly what i wanted. i’m looking for a solution that can be applied to all posts.

    <div class="featured-media">
    <img width="xxx" height="xxx" src="https://xyz" class="attachment-post-image wp-post-image" alt="imagename-xxxx-xxx">
    </div>

    I found this section for feature image in single.php but not sure how to fix it? Please help.

    <div class="featured-media">
    
    							<?php garfunkel_flexslider('post-image'); ?>
    
    						</div> <!-- /featured-media -->
    
    					<?php elseif ( has_post_thumbnail() ) : ?>
    
    						<div class="featured-media">
    
    							<?php the_post_thumbnail('post-image'); ?>
    
    							<?php if ( !empty(get_post(get_post_thumbnail_id())->post_excerpt) ) : ?>
    
    								<div class="media-caption-container">
    
    									<p class="media-caption"><?php echo get_post(get_post_thumbnail_id())->post_excerpt; ?></p>
    
    								</div>
    
    							<?php endif; ?>
    
    						</div> <!-- /featured-media -->

    OK; I managed to center featured image with:

    <div class="featured-media" align="center">

    I wish I was as smart as you guys!

    Where exactly do I add align=”center” please?

    In single.php you have <div class="featured-media">
    Change it to

    <div class=”featured-media” align=”center”>

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Center featured image’ is closed to new replies.