Still need help with this. Thanks!
right now, your linked site shows six square thumbnail images, one for each post on the front page.
what is the code you are using for the images on the front page (in content.php)?
if you are referring to single posts, what is the code in content-single.php for the images? (however, i can’t see any thubnail image in any of the single posts)
btw:
please consider to create a child theme for Twenty Eleven instead of directly editing the theme (the default theme of a wordpress version should remain unedited as a fallback in case of problems).
a child theme will also help to keep customisations when you next upgrade your wordpress version.
I believe it is this:
<figure class="gallery-thumb">
<a href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
</figure><!-- .gallery-thumb -->
It works for 2/6 posts I have on there: the first in the blog order and the last in the blog order. The ones in the middle show the first image embedded in the blog, but not a featured image (which I set).
I have a problem with featured images in my website. I have been able to set the top images on five pages (including the Main or blog page). Now I want to add two more pages and change the first page loaded to be a welcome page. When I do this: create a new page (Blog); set first page to be Welcome; set blog page to be Blog; this happens:
The original image on the original Home page becomes the image on three of the pages. When I try to change the image the change shows as the featured image in WordPress Administration but does not actually show up on the website. The previous image remains on the page top.
I have done this twice and ended up restoring the site twice. I am not stupid, but not facile with html or sql; I just use the standard wordpress theme (twenty eleven) and the administration web page.
Help, please. Meanwhile I am giving up on the idea of having the first page not be the blog. sigh.
If it were possible to put an Order on the first page, that would do it for me. I can order the other pages via the number … that works.
@jim Bennett: Don’t highjack another poster’s thread. Please post a new topic.
Sorry, I thought mine was a related problem. new thread started.
@gangwani
where is this coming from: $image_img_tag ?
there has to be some code where this is defined –
please paste the full code of the template into a http://pastebin.com/ and post the link to it here.
Without access to your dashboard (which i don’t want to have) it is quite impossible to check and verify where the shown image comes from (all images on the front page have the same css class which is usually used for thumbnail images)
@alchymyth
The variable comes from “content_gallery.php”:
<?php
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
if ( $images ) :
$total_images = count( $images );
$image = array_shift( $images );
$image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
?>
The entire file is the default content_gallery.php except that I commented out a section. See here: http://pastebin.com/5DT1Enn6
Thanks again for the help guys.
there might be a general misunderstanding of ‘featured image’ aka ‘the_post_thumbnail’
http://codex.wordpress.org/Post_Thumbnails
your used code will get one of the attached images from the post – not the ‘featured image’
try to re-code the section to use the functions for the post thumbnail, possibly using http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail