Support » Themes and Templates » Would like my template to only show one image per post until clicked

  • 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.

Viewing 15 replies - 1 through 15 (of 19 total)
  • esmi

    (@esmi)


    Forum Moderator


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

    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

    Oooh dear…

    Im unsure where I am to post this in my site… please help 🙂

    esmi

    (@esmi)


    Forum Moderator


    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.

    Owwweeewooo!! Thanks you,

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

    🙂

    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?

    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]

    here is the code:

    http://wordpress.pastebin.ca/1833827

    thanks, sorry mods, had no idea…

    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:

    Everything you need to know about WordPress 2.9’s post image feature

    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 🙂

    esmi

    (@esmi)


    Forum Moderator


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

    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.

    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

    esmi

    (@esmi)


    Forum Moderator


    Site url?

    Hi sorry,

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

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Would like my template to only show one image per post until clicked’ is closed to new replies.