1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can anyone with Word Press knowledge please tell me whats wrong!

Discussion in 'BlackHat Lounge' started by mycasinorocks, Jul 15, 2010.

  1. mycasinorocks

    mycasinorocks Newbie

    Joined:
    Apr 15, 2009
    Messages:
    25
    Likes Received:
    1
    I have a worpress 3.0 News site and for the life of me, I cant get excerpts thumbnails to work on the home page. If you click the post the thumbnail is correct but the excerpt uses my default image. I have used this theme and others in the past without issues. I also use wp-o-matic for the auto blogging.
    Other themes I used thumbnails for excerpts on but this one doesn?t need it says the creator..
    The site is goldencrestnews.com and the theme is breaking news.
    Here is the index.php
    <?php get_header(); ?>
    <div id="pbody">
    <?php include(TEMPLATEPATH."/sidebar.php");?>
    <div id="content">
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    <div class="ptitle"><h2 class="title">
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2></div>
    <div class="entry">
    <?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
    <a href="<?php the_permalink() ?>" rel="bookmark"><<img style="float:left;margin:15px 10px 0px 0px;"
    src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="<?php the_title(); ?>" /></a>
    <?php else: ?>
    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:15px 10px 0px 0px;" src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" alt="<?php the_title(); ?>" /></a>
    <?php endif; ?>
    <?php the_content_limit(500, "[Read more...]"); ?>

    </div>
    <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    </div>
    <?php endwhile; ?>
    <div class="navigation">

    <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
    else { ?>

    <div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
    <?php } ?>

    </div>
    <?php else : ?>
    <?php include(TEMPLATEPATH."/404.php");?>
    <?php endif; ?>
    </div>
    <?php include(TEMPLATEPATH."/sidebar2.php");?>
    </div>
    <?php get_footer(); ?>


    Maybe it?s something new with 3.0 or something.
    Any input will be appreciated!
    Thanks

    P.S. it was 2.9 and I updated to see if that would fix the issue.
     
  2. angelas111

    angelas111 Jr. VIP Jr. VIP Premium Member

    Joined:
    Jan 4, 2009
    Messages:
    1,570
    Likes Received:
    1,016
    Location:
    ohio
    maybe the excerpt plug in is not compatible with either. go to wordpress.org and look up the plugin and see its latest compatibility and when it was last updated.
     
  3. mycasinorocks

    mycasinorocks Newbie

    Joined:
    Apr 15, 2009
    Messages:
    25
    Likes Received:
    1
    Thanks for the reply. I'm not using a plugin for the excerpt. The theme was developed to do this without a plugin.
    Here is the only code I could find that was in the index.php file

    <a href="<?php the_permalink() ?>" rel="bookmark"><<img style="float:left;margin:15px 10px 0px 0px;"
    src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="<?php the_title(); ?>" /></a>
    <?php else: ?>
    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:15px 10px 0px 0px;" src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" alt="<?php the_title(); ?>" /></a>
    <?php endif; ?>

    Forgive me, I'm just a PHP hack, not a code guy so let me know when if I'm way off base..
     
  4. lord

    lord Junior Member

    Joined:
    Jan 21, 2009
    Messages:
    176
    Likes Received:
    251
    well i think that you should use this

    Code:
    echo get_post_meta($post->ID, "thumb", true);
    instead of this
    Code:
    echo get_post_meta($post->ID, "thumbnail", true);
    wherever is the case :)
     
  5. mycasinorocks

    mycasinorocks Newbie

    Joined:
    Apr 15, 2009
    Messages:
    25
    Likes Received:
    1
    thanks. Did what you suggested but still no luck..
     
  6. Trecoolius

    Trecoolius Registered Member

    Joined:
    Apr 4, 2010
    Messages:
    70
    Likes Received:
    21
    Since I'm in the middle of creating my own wp3 theme, I think I can help you with that.

    1.- Make sure you include this code into your theme's function.php:

    Code:
    <?php
        add_theme_support( 'post-thumbnails' );
        set_post_thumbnail_size( 60, 60 );
    ?>
    
    2.- Then whenever you need to call the thumbnail just use:

    Code:
    <a class="whatevever_you_want" href="<?php the_permalink() ?>" rel="bookmark"><?php if  ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) { the_post_thumbnail(array(60,60)); } ?></a>
    
    Hope that helps dude!
     
    • Thanks Thanks x 1
  7. mycasinorocks

    mycasinorocks Newbie

    Joined:
    Apr 15, 2009
    Messages:
    25
    Likes Received:
    1
    No luck. Thanks for all the suggestions. I think I?ll just try using another theme.
     
  8. mycasinorocks

    mycasinorocks Newbie

    Joined:
    Apr 15, 2009
    Messages:
    25
    Likes Received:
    1
    Used different theme and all is working now