• I know I’m missing the obvious here! I’ve updated to 2.9, edited the them to allow thumbnails, but I can’t seem to figure this one out.

    I want to add a thumbnail from the full post to the “teaser” posts on the site front page. If I add the actual reference, the title displays with a “>” in front of it, as if the tag wasn’t closed.

    I hoped the new post thumbnail function would allow me to do that, but if it does I’m not getting it. To see how it looks, please go to https://www.sabellastudios.com.

    I would greatly appreciate anyone who could tell me how to accomplish this. As of now, the string in the title (to use the first post example) is:
    Gotham Green records a track at Sabella <img class=”size-full wp-image-218″ title=”Gotham Green” src=”https://www.sabellastudios.com/wordpress/wp-content/uploads/2010/05/s50039121.jpg&#8221; alt=”Gotham Green” width=”175″ height=”131″>

    Thanks!!!

Viewing 12 replies - 1 through 12 (of 12 total)
  • 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>

    Thread Starter therealex

    (@therealex)

    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.

    Thread Starter therealex

    (@therealex)

    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?

    Thread Starter therealex

    (@therealex)

    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 (https://justintadlock.com/archives/2009/11/16/everything-you-need-to-know-about-wordpress-2-9s-post-image-feature
    and
    https://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.

    Thread Starter therealex

    (@therealex)

    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!

    Thread Starter therealex

    (@therealex)

    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.

    Thread Starter therealex

    (@therealex)

    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.

    Thread Starter therealex

    (@therealex)

    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!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Graphic in title’ is closed to new replies.