Try something like:
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php if( has_post_thumbnail() ) the_post_thumbnail();> <?php the_title(); ?></a></h2>
Thanks for the response! That would go – where? In the style.css file, or right there in the title?
In your theme’s index.php template file – inside the Loop.
I tried it, but it still doesn’t show the thumbnail. I tried inserting the thumbnail into the post, and then I tried the “use as thumbnail” option. Neither one would generate the picture along with the title. I also tried it with and without the code in the title.
Any other ideas as to how this might work? I appreciate your time, thanks!
Did you remember to set a post thumbnail on the post in the Edit Post page?
Did you remember to set a post thumbnail on the post in the Edit Post page?
yes, I used the “Post Thumbnail” command. I chose one from the Gallery, kept it as a thumbnail, clicked “insert into Post”, then clicked “Save all changes”. I also tried again, this time using “use as Thumbnail” instead of “insert into Post”.
I’m using the Bytetips theme with no Widgets. I added the line add_theme_support(‘post-thumbnails’); so the functions.php looks like:
<?php
add_theme_support(‘post-thumbnails’);
if ( function_exists(‘register_sidebars’) )
register_sidebars(2,array(
‘before_widget’ => ”,
‘after_widget’ => ”,
‘before_title’ => ‘<h2>’,
‘after_title’ => ‘</h2>’,
));
Did I do it right? I looked through the tutorials (http://justintadlock.com/archives/2009/11/16/everything-you-need-to-know-about-wordpress-2-9s-post-image-feature
and
http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/
and I thought I did it right…
I appreciate your help – I just can’t figure out what I’m doing wrong here!
What you describe appears to be correct.
I’m stumped. When I try it with the default theme, it messes up his entire site (which is PHP coded, not by me, and doesn’t use WP as a basis).
No idea why, but I suspect it may have something to do with the way the summaries are posted on his main page. Perhaps it’s something in the way the page is coded. Anyway, thanks for your generous help and time. At least I know I did it the right way!
I’ve found the error – it’s in the Bytetips theme that I’m using. It calls Category-18.php for the teaser posts. The coding uses:
<div id=”content”>
<?php if (have_posts()) : query_posts($query_string .’&cat=18′); ?>
<?php while (have_posts()) : the_post(); ?>
<div class=”post” id=”post-<?php the_ID(); ?>”>
<h2>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”>
<?php the_title(); ?></h2>
Notice the extra “> on title=”Permanent Link to <?php the_title(); ?>”>. It’s not really extra, it’s closing the <a href) tag, but it ends up being “orphaned” when there’s a graphic embedded in the title.
I can’t figure out how to fix it, since if I remove it the posts with graphic comes out great, but the non-graphic ones end up being the wrong font size.
I realize how swamped you are, but if you have any suggestions I would sure appreciate it. Bytetips doesn’t seem to be doing WP anymore.
Sorry, I see the quote didn’t come in correctly – I forgot to use the code command!
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
The code I gave further up should still work in that template file.
Thanks for the reply. No idea why it doesn’t work – I added it to the index.php file, as you said. I hate it when stuff doesn’t work like it should!