WordPress.org

Ready to get started?Download WordPress

Forums

Featured Image next to blog posts (13 posts)

  1. shock976
    Member
    Posted 2 years ago #

    I have created a child theme of TwentyTen, and am trying to figure out how can have thumbnail images next to my blog posts? I want them to show on the excerpts, category archives, blog page, etc. I want it to look like the agentpress theme posts.

    I have tried copying the loop.php file into my child theme folder, and adding <?php the_post_thumbnail( 'thumbnail' ); ?> as recommended by other resources, but it doesn't work. I renamed the loop.php file to loop-index.php so as to not conflict with the twnetyten core file.

    Any help is appreciated.

  2. shock976
    Member
    Posted 2 years ago #

    just for reference, my site is: http://www.jerodmayer.com

  3. Alex
    Member
    Posted 2 years ago #

    Do you see "set as featured image" link while uploading picture? If you do - have you tried it, if you don't see the link, then you need to add add_theme_support( 'post-thumbnails' ); to your functions.php and make sure you declared the_post_thumbnail( 'thumbnail' ); before you call it in your theme

  4. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    and adding <?php the_post_thumbnail( 'thumbnail' ); ?> as recommended by other resources, but it doesn't work

    a:
    where exactly did you add this?
    (loop.php is quite a complex, large file)
    b:
    what is 'doesn't work' explained in useful terms?

    i would try to add it here in this section (around line 140 - this is about 40 lines from the end of the file):

    <div class="entry-content">
    				<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
    				<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
    			</div><!-- .entry-content -->
  5. shock976
    Member
    Posted 2 years ago #

    I thought I clarified, sorry.

    Yes I do see a "add featured image" when writing a post. I have selected a featured image and nothing shows next to the post. I also placed the <? get_post_thumbnail tag to the loop.php file right above "the content" line specified by alchymyth with no avail. In the twentyten loop file there are a couple of the "the_content" areas, and I tried placing the tag to call the thumbnail in both spots, again nothing.

    When I say it didn't work. I mean that no image shows up next to the posts. Categories are no go, archives, etc.

    I am stuck, unless I am missing something... I hope this helps all who relied identify the issue I am having.

  6. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    I want them to show on the excerpts, category archives, blog page, etc.

    blog page - is that the front page with the 'featured' posts?

    on the excerpts, category archives - you would need to add the thumbnail code here:

    <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
    			<div class="entry-summary">
    				<?php the_excerpt(); ?>
    			</div><!-- .entry-summary -->
    	<?php else : ?>

    (a few lines before the section i posted earlier)

  7. shock976
    Member
    Posted 2 years ago #

    Aichymyth: I did try adding the "get_thumbnail" code here where you suggested as well, but for some odd reason I am not seeing my thumbnails appear. The featured posts on my front page are just the most recent 4 posts and this section of my blog just pulls images at random from a image folder on my server.

    I was under the impression a random image would only be used if I didn't choose a featured image fkr a Post. This is only codee for My front page lime this which is a Custom template. Do you think this is what is screwing up my olvide posts?

    I am stumped, cuz once I add the thumbnail code the image should appear right? Hope you can help, you have been great this far.

  8. shock976
    Member
    Posted 2 years ago #

    Anything else that could be wrong? Should I show you any of my files for verification?

  9. shock976
    Member
    Posted 2 years ago #

    OK I am really stumped... I have added the <?php the_post_thumbnail( 'thumbnail' ); ?> to my loop below in my TwentyTen Child Theme, however thumbnails only show on my blog page, and not in specific categories, or archived categories. Also, I want the thumbnail to show on the left side of the post so that there is a cleaner look. Can someone help me get this to work properly?

    <?php /* How to display all other posts. */ ?>

    <?php else : ?>
    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <h2 class="entry-title">" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></h2>

    <div class="entry-meta">
    <?php twentyten_posted_on(); ?>
    </div><!-- .entry-meta -->

    <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
    <div class="entry-summary">
    <?php the_post_thumbnail( 'thumbnail' ); ?>
    <?php the_excerpt(); ?>
    </div><!-- .entry-summary -->
    <?php else : ?>
    <div class="entry-content">
    <?php the_post_thumbnail( 'thumbnail' ); ?>

    <?php the_excerpt( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?>
    <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
    </div><!-- .entry-content -->
    <?php endif; ?>

  10. shock976
    Member
    Posted 2 years ago #

    Does nobody have a remedy for this? Is it something wrong with twentyten 1.2 theme? Blog Category excerpts and blog archive excerpts don't show a thumbnail. Now can I get them there?

  11. sholdstock
    Member
    Posted 2 years ago #

    Hey,

    Sounds like I am having the same problem.... did you ever manage to resolve this?

    Stephen :)

  12. esmi
    Forum Moderator
    Posted 2 years ago #

    @sholdstock: Please post your own topic.

  13. pebbleart
    Member
    Posted 2 years ago #

    I had this problem as well. In twenty ten I had to add the code to the 'loop-single.php' page to get it to show. Hope that helps someone.

Topic Closed

This topic has been closed to new replies.

About this Topic