How to move featured image
-
I would like to my featured image from above my text on the blog page to being in line with the text.
Here’s an image to show you what I mean, is this possible?
-
You need to edit the php template to do this. It may be a case of adding a class to the featured image, or maybe be moving the featured image – it all depends on how it’s been coded in to begin with.
We can’t help much from just a screenshot though…
What would you need in order to see?
Here is my functions.php http://pastebin.com/FFECt4vs
Here is my index.php
http://pastebin.com/iVP4MJY6This is the relevant bit from your index.php:
<section class="entry-content clearfix"> <?php the_post_thumbnail(); ?> <?php the_excerpt(); ?> </section> <!-- end article section -->Maybe wrap
<?php the_post_thumbnail(); ?>in a div and style it accordingly:So:
<div class="blog-image"><?php the_post_thumbnail(); ?></div>and then:
.blog-image { float: left; margin: 0 10px 10px 0; }Thanks WPRanger, i’ve now put it in a div and added the
.blog-image { float: left; margin: 0 10px 10px 0; }The CSS doesnt seem to be changing the image though, I tried to float right just to see if it would change anything but had no luck
You seem to have wrapped the entire section in the div, not just the image. Also, you named the style blogimage rather than blog-image if that makes a difference although I can’t see any of them in your stylesheet?
Thanks for your persistence! I have the following in the index
<div class="blogimage"><?php the_post_thumbnail(); ?></div>And this in the style.css
.blogimage { float: left; margin: 0 10px 10px 0; }Here’s a link to the page if that helps
You have some caching on your site. Can you flush the caches and see what happens?
Emptied cache still no change 🙁
Where did you put the CSS, it’s not in your stylesheet.
Applying the CSS via Firebug shows this:
Sorry about the nasty font, my machine playing silly with me
I’m placing it inside the style.css, would it make a difference in what section of the style.css I was placing it into?
We’re still looking at the cached version of the CSS file. The CSS you applied is not in there.
From your request-headers:
If-Modified-Since Mon, 04 Nov 2013 10:07:12 GMTI just deactivated the cache plugin and its updated my end, i’ve no idea why the cache is playing up. I’ve now reactivated it and it seems fine. Thanks for all the help you and your code have been brilliant!
I guess I just need to keep in mind the cache plugin when I edit the css
Thanks again
Matt
The topic ‘How to move featured image’ is closed to new replies.