Having trouble with my new theme

Discussion in 'WordPress' started by longtime, Jan 14, 2010.

  1. #1
    I have been trying to figure out a way so that these things occur:
    1. index displays ONLY a thumbnail image with a title under it for each post
    2. Option for uploading a thumbnail when adding a post

    This is for a theme I am creating for a video website.
    I have looked at other themes that have similar functions, but I had no luck figuring out how it exactly works.

    Could anyone please help me with this?
     
    longtime, Jan 14, 2010 IP
  2. Wp-Mod.Com

    Wp-Mod.Com Peon

    Messages:
    381
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    rather easy dont add the excerpt class in index.php and just the thumbnail and some css code will help you breing title over the image , it way too damn easy , i can do this but if you pay me some thing for it
     
    Wp-Mod.Com, Jan 14, 2010 IP
  3. longtime

    longtime Well-Known Member

    Messages:
    569
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    115
    #3
    Don't really understand what you mean.
    I'm not well experienced in PHP.
     
    longtime, Jan 15, 2010 IP
  4. sevnrock

    sevnrock Peon

    Messages:
    241
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    This requires a small bit of PHP knowledge and CSS.

    I'll try to walk to you through it here. Goto your index.php template file in your Theme Editor and look for this code:

    <?php the_excerpt(); ?> or it might be <?php the_content(); ?> (depending on your theme)

    And just delete that line - that will remove the post's content on your front page.

    Next up is positioning where your thumbnail will be. You should make sure you set up your *.css to style it however you want. Look for where your titled is called: <?php the_title(); ?>

    Place the thumbnail code above that. You will need to download the timthumb.php script and upload it to your theme folder (really easy, it's just one little script).

    The code you will place above the title is:

    <?php if (get_post_meta($post->ID, 'thumbnail', true)) : ?>
    <img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src="<?php echo get_post_meta($post->ID, 'thumbnail', $single = true); ?>&h=***&w=***zc=*&q=***" />
    <?php else : ?>
    <img src="URL to a stock photo if you don't upload a pic for a post" />
    <?php endif; ?>

    h = height, w = width, zc = zoom crop, q = quality. To style it, that's where CSS comes in. You can add class="whatever" to the image or just div wrap it entirely.

    Now for every post you make, you need to create a new custom field named thumbnail and make the value the entire URL of the image.

    Hope that helps!
     
    sevnrock, Jan 15, 2010 IP
  5. johagulo

    johagulo Peon

    Messages:
    879
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Inability of earning money is bad. People usually blog regularly for money
     
    johagulo, Jan 16, 2010 IP
  6. abhijit

    abhijit Notable Member

    Messages:
    4,094
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    215
    #6
    you can use wp plugins........................for thumbnail your videos.............
     
    abhijit, Jan 16, 2010 IP