SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    May 2007
    Location
    West Coast
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Created Theme for 1st time - small problems

    It felt good to create a theme from a template but I have run into a few problem areas I am not aware of how to fix.

    1.) The post code to get the latest posts, show a bigger image of the image in the post which is sized at 310 width but there is a much bigger before the content. (see image below) There is only one image in my post.

    here is my code I inserted from a tutorial

    Code:
    <?php if ( have_posts() ) : ?>
    <?php while ( have_posts() ) : the_post(); ?>
      <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
        <div class="post-header">
            <div class="date"><?php the_time( 'M j y' ); ?></div>
            <h2><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
            <div class="author"><?php the_author(); ?></div>
        </div><!--end post header-->
        <div class="entry clear">
            <?php if ( function_exists( 'add_theme_support' ) ) the_post_thumbnail(); ?>
            <?php the_content(); ?>
            <?php edit_post_link(); ?>
            <?php wp_link_pages(); ?>
        </div><!--end entry-->
        <div class="post-footer">
            <div class="comments"><?php comments_popup_link( 'Leave a Comment', '1 Comment', '% Comments' ); ?></div>
        </div><!--end post footer-->
      </div><!--end post-->
    <?php endwhile; /* rewind or continue if all posts have been fetched */ ?>
      <div class="navigation index">
        <div class="alignleft"><?php next_posts_link( 'Older Entries' ); ?></div>
        <div class="alignright"><?php previous_posts_link( 'Newer Entries' ); ?></div>
      </div><!--end navigation-->
    <?php else : ?>
    <?php endif; ?>
    2-images-on-post.jpg

    2.) When I click on the title to go to the full post page, it is all broken. it says "Post navigation" Lave a reply."
    also it opens up a new window which I prefer it not too.
    is there another crucial page I need to make there I may have left out?

    I have single.php, comments, functions, header, footer, sidebar.php, index,


    If I switch to another theme, there are no problems or double images or broken link navigation to the blog post page

    Thanks

  2. #2
    SitePoint Addict
    Join Date
    May 2007
    Location
    West Coast
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Update...I got rid of big pic by unchecking set as featured image in the posts area.. But that removes the image from my sidebar widget and puts in a generic "w" wp image

  3. #3
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    781
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I am not an expert but if you have set a featured image wordpress will use one of the additional sizes it created of the same images and used it for the thumbnail.
    basically wp is using the same image but at diff size (see wp admin>settings>media) & of course you can also add more sized but tweaking functions.php.
    so if you remove the featured image it will also remove the thumbnail.
    Not sure why it would give you a "w"
    I don't see any duplicate calls for the thumbnail...so not sure. I could suggest only simplifying your code and slowly adding staff up. at this wp link you may find other useful examples for loading in a thumbnail.
    http://codex.wordpress.org/Function_...post_thumbnail

  4. #4
    SitePoint Guru
    Join Date
    Oct 2010
    Location
    Portland, Or
    Posts
    781
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    also just try <?php echo get_the_post_thumbnail(); ?> that alone should do it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •