You do know that something is supposed to be a particular image size – not a specific image from your Media Library, yes?
and where is it defined? because something is not similar to 250×250 but to “Hello”.
I was checking:
http://codex.wordpress.org/Function_Reference/add_image_size
Here it is said that add_image_size() add an image size, but neither ‘something’ nor ‘whatever’ appears.
I can’t find it…
I’m sorry but I am really not following you. Neither add_image_size() nor the_post_thumbnail() take a file name as a parameter.
I’m sorry but it does, as stated in:
http://codex.wordpress.org/Function_Reference/the_post_thumbnail
in the Thumbnail Sizes section.
And I can assure you my website does use it, and it changes if I’m using
the_post_thumbnail() or the_post_thumbnail('something').
And what is something? Can you provide specific and not just generic examples?
it changes if I’m using
the_post_thumbnail() or the_post_thumbnail(‘something’).
can you post a link to your site, where you use both codes within one template, to illustrate the different output?
what theme are you working with?
if the (original) theme is not from http://wordpress.org/themes/, have you contacted the developer of the theme for support?
I have a news template, which contains the text:
<div class="span4"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('news1'); ?></a></div>
I can’t find “news1” anywhere (I did not program it).
The code above is supposedly displaying information of a post created in the backend, lets say post1. This post1 contains one featured image, which is not news1.
However, inspecting the code of the website, this <?php the_post_thumbnail('news1'); ?> displays an image from a folder, image called “The-first-news.jpg”, which is a completely different name.
So I want to display another image instead of “The-first-news”, but I can’t understand the code or find where the link between news1 and The-first-news is set.
Where did you download this theme from?
alchymyth, it’s a customized theme, and I did not contact the developer by now.
If i use the_post_thumbnail() I get the featured image upload in the post in the back end.
If i use the_post_thumbnail('something'), I get a different image, which is not uploaded in the post featured images.
<?php the_post_thumbnail('news1'); ?> is referring to a specific image size defined (presumably) in the theme’s functions.php file using add_image_size(). It is not referring to a specific image as far as I can tell.
I can’t find “news1” anywhere
if the corresponding thumbnail size is not defined in your theme, then the default size will get used.
to repeat:
the argument of the the_post_thumbnail() function does not refer to a file name.
please make yourself familiar with http://codex.wordpress.org/Post_Thumbnails
the ‘featured images’ aka post thumbnails of a post or page are set when editing the post or page;
http://codex.wordpress.org/Post_Thumbnails#Setting_a_Post_Thumbnail
So,
1. news1 should be defined in the functions file, which is not. I got 5 add_image_size(); code lines, and none of them is for news1.
2. the image displayed size is 280×250, which is a different size from all add_image_size(); defined in the functions file
3. my media settings in the backend are:
thumbnail size: 150×150
medium size: 300×300
large size: 1024×1024.
So where is ‘news1’ defined?
You need to ask the theme’s developer that question. As this is a custom theme, we can’t really help a great deal.