WordPress.org

Ready to get started?Download WordPress

Forums

Would like my template to only show one image per post until clicked (20 posts)

  1. gobinder
    Member
    Posted 4 years ago #

    I hope there is a wordpress wizard who can help..

    I did post this in the troubleshooting section but think it should belong here?

    My blog i at http://www.gobinderjhitta.co.uk/blog and what i was after was on my homepage, each entry will show only one image from each post, then you should be able to click and read more, opening a page containing the rest of the images as on this site http://www.brumlive.com/

    I couldn't work this out, so created a separate page and linked off the image, which doesn't work as no comments can be added, and the section header directs you elsewhere.

    If someone could help, i really would appreciate it... It seems like its something straight forward as can see the option for the link in the code, but it just doesnt work...

    Thanks in advance.

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    http://codex.wordpress.org/Template_Tags/the_post_thumbnail
    Should be exactly what you are looking for.

  3. gobinder
    Member
    Posted 4 years ago #

    Esmi,

    Thank you very much :)

    Im going to rush and rush my job on and try this shortly, Ill let you know how I get on, im no coding genius so even the simplest things bug me with code...

    Fingers crossed...

    Thanks again

  4. gobinder
    Member
    Posted 4 years ago #

    Oooh dear...

    Im unsure where I am to post this in my site... please help :)

  5. esmi
    Forum Moderator
    Posted 4 years ago #

    Something like

    <?php if( function_exists( 'add_theme_support' ) ) the_post_thumbnail(); ?>
    <?php the_excerpt();?>
    <a class="more-link" href="<?php the_permalink();?>"><?php _e('Continue reading ') . the_title();?></a>

    in place of <?php the content();?> in your theme's index.php template file should work.

  6. gobinder
    Member
    Posted 4 years ago #

    Owwweeewooo!! Thanks you,

    will give it a bash in a tick. Thanks again for your help..

    :)

  7. gobinder
    Member
    Posted 4 years ago #

    oh dear this happend?

    http://www.gobinderjhitta.co.uk/blog/

    Fatal error: Call to undefined function the_post_thumbnail() in /home/creati20/public_html/www.gobinderjhitta.co.uk/blog/wp-content/themes/funtones/index.php on line 31

    please help.. i just replace it with the new code?

  8. gobinder
    Member
    Posted 4 years ago #

    This is the working version (well without the error but not functioning as i wanted) index.php - I hope it makes some sense, as im stumpped! thanks

    [Code moderated as per the Forum Rules. Please use the pastebin]

  9. gobinder
    Member
    Posted 4 years ago #

    here is the code:

    http://wordpress.pastebin.ca/1833827

    thanks, sorry mods, had no idea...

  10. gregnak
    Member
    Posted 4 years ago #

    First, open your functions.php
    add this:
    add_theme_support( 'post-thumbnails' );

    In your index.php find:

    <div class="entry">
            <?php the_content('<b>Read More</b>'); ?>
       </div>

    Change to something like this:

    <div class="entry">
       <div class="post_thumbnail">
         <?php the_post_thumbnail( 'thumbnail' ); ?>
       </div><!--End .post_thumbnail -->
       <?php the_content('<b>Read More</b>'); ?>
    </div>

    And you should get the thumbnail. You must first, however add a thumbnail by edit the posts.
    If you dont know how to do that. Read this:
    http://justintadlock.com/archives/2009/11/16/everything-you-need-to-know-about-wordpress-2-9s-post-image-feature

  11. gobinder
    Member
    Posted 4 years ago #

    Hi there.. it didnt work?

    I was hoping that when i ccreate a post... it would then let me add anothe page of images with comments and also liked to prevous page.. myabe it me and i dont understand blga... please let me know :)

  12. esmi
    Forum Moderator
    Posted 4 years ago #

    Post won't inter-link with one another unless you manually add the links.

  13. gobinder
    Member
    Posted 4 years ago #

    So I need o create a post, then create an additional page?
    I did this on the current post on my blog, but was only able to achieve this by clicking the image.

    What I was hoping for, which I think is what happens on http://www.brumlive.co.uk is when you click the post header, you are redirected to a page with text/images, and a comments box below. At the moment, when the header is clicked, the only thing that comes up is what is on the homepage, I would like there to be a page of all the images from that concert.

    I may have misinterpreted exactly what I wanted to do, if i did, apologies.

  14. gobinder
    Member
    Posted 4 years ago #

    Sorry, if i can add, I am unable to change the link for the header to redirect to a page created with the images on. thanks

  15. esmi
    Forum Moderator
    Posted 4 years ago #

    Site url?

  16. gobinder
    Member
    Posted 4 years ago #

    Hi sorry,

    My site URL is http://www.gobinderjhitta.co.uk/blog

  17. esmi
    Forum Moderator
    Posted 4 years ago #

    If you click on the title of any individual post on your Home page (eg "Hello you….how you doing?"), it will take you to a page (single post page) that just displays that post: http://www.gobinderjhitta.co.uk/blog/2010/03/09/hello-you-how-you-doing/ - with all images, full text content and a comment form.

    You might want to have a read of First_Steps_With_WordPress

  18. gobinder
    Member
    Posted 4 years ago #

    When I tried to ad addional images and text, they also displayed on my homescreen, which changed my blog snippit to the full blog entry on the homepage?

    I must be doing something wrong?

  19. Saildude
    Member
    Posted 4 years ago #

    Have you tried using "More"?? to break the post at the point you want to stop the display for the Front Page?

    "More" is what the Birmingham site uses. See the top of your post editor for the two boxes with the line between them. Put "Read More" wherever you want -

    See also: http://codex.wordpress.org/Getting_Started_with_WordPress

  20. gobinder
    Member
    Posted 4 years ago #

    Thank you ever so much...THATS IT!!!!

    Sorry, i am, as you can guess, a total wordpress novice..

    I just want to say a huge, BIG THANKS!!!

    I shall now go to bed happy... :)

Topic Closed

This topic has been closed to new replies.

About this Topic