Why is the closing after the content?
HTH
David
Thread Starter
ttmt
(@ttmt)
sorry I didn’t know about the forum number of lines of code rule
here is the code
http://pastebin.com/bQVcV33V
Digital Raindrops – I don’t undertand, why is what closing after the content?
David is referring to the closing tag </a>
for the link after ‘the_content()’ – having the link wrap the whole content is quite a stretch and can lead to problems and invalid code.
there is no obvious reason in your code why a ‘featured image’ whould not get shown in the loop.
are you sure you have a ‘featured image’ assigned to the post(s)?
http://codex.wordpress.org/Post_Thumbnails
Thread Starter
ttmt
(@ttmt)
I have removed the tag so it doesnt wrap but I still dont have the thumbs.
Im sure I have the featured images assigned in the posts. In the post I have the Featured Image on the right and inside it I have the image.
http://pastebin.com/gwsKhUBF
just double checking:
do you have a ‘featured image’ assigned to the post(s) in the dashboard – posts – edit post page, as in the attached screenshot?
http://imageshack.us/photo/my-images/690/featuredimagedashboard.jpg/
also, review http://codex.wordpress.org/Post_Thumbnails
whatever images are within the post content does not matter.
Thread Starter
ttmt
(@ttmt)
Yes I have a ‘featured image’ assigned to the post(s) in the dashboard.
http://www.ttmt.org.uk/img.png
I have read http://codex.wordpress.org/Post_Thumbnails but I can’t see anything there that I haven’t done.
I think it might be time to give up.
what happens if you remove the conditional code:
change this section:
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail();
}else{
echo 'no thumbs';
}
?>
to:
<?php the_post_thumbnail(); ?>
– occasionally, a plugin interferes with some code;
try to deactivate all plugins to see if that solves the problem; then re-activate one at a time to find the problem one.
Thread Starter
ttmt
(@ttmt)
Removing the conditional and using
<?php the_post_thumbnail(); ?>
doesn’t do anything. I was using the conditional statement to try and debug the problem.
I’m only using NextGen gallery at the moment, I turned that off but still no luck.
Hi,
I have tested this, it is a Page template” so only can be used on a page:
Copied your code from pastebin
Created a file and saved it in a themes folder
Run WordPress, went to a page,
Set the featured image, and the template page as “Home” saved and viewed the page.
The image shows just fine, so you code is fine, you say the theme has thumbnail support in the functions.php file?
add_theme_support( 'post-thumbnails' );
HTH
David
Thread Starter
ttmt
(@ttmt)
David thanks for your time looking into this.
I think I might have this wrong, I’ll explain what I was trying to do.
I was hoping to create a simple photography gallery. I have a post for each
section of the gallery. I have three posts with the titles Portrait, Fashion and Travel. Each of these posts have a featured image attached and a NextGen Gallery in the post with all the image for the section.
I have a Page in WP with a title of Home(this is the first/index page). This page has home.php set as it’s template.
http://pastebin.com/MabrprQp
So I simply wanted this home page to display each of the posts(Portrait,Fashion,Travel) featured images.
==
If I add a featured image to the Home page in WP that is displayed. I think the code is working, but not to do what I wanted.
Is it possible to display the featured image of each post on the home page?
I really would appreciate any hep with this.
i advice you to back up your site because some times it gives an error and ur site stops working backup it before doing anything
Thread Starter
ttmt
(@ttmt)
todayheads – what site are you talking about?
I haven’t posted any sites here.
thanks for explaining your setup.
you need to add a query before the <?php if (have_posts()) :
line to get the page template to show your choice of posts;
example (to show 5 posts of all categories):
<?php query_posts('cat=0&posts_per_page=5&paged='.get_query_var('paged')); ?>
and after the <?php endif; ?>
line, add:
<?php wp_reset_query(); ?>
http://codex.wordpress.org/Function_Reference/query_posts
http://codex.wordpress.org/Function_Reference/wp_reset_query
Thread Starter
ttmt
(@ttmt)
Thanks alchymyth, got it working now.
I thought query_post was when I wanted to alter the default post that just outputs the posts
The Codex even says
For example, on the homepage, you would normally see the latest 10 posts. If you want to show only 5 posts (and don’t care about pagination), you can use query_posts() like so:
I see thats just the way it is but is there a reason I need the query and the post aren’t just output?