Support » Fixing WordPress » click photo to go back…photoblog question

  • Does anyone know how i can set up my photoblog where when the viewer clicks on the photo it takes them to the previous days photo???
    thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • Gonna need a little more info to help ya, bud. What are you using for the photoblog? Where is it located (url)? Etc.

    Thread Starter ayteale

    (@ayteale)

    http://ryanflynnphoto.com/blog
    im using WP 1.2 and a chopped up Pictorialis
    thanks

    Thread Starter ayteale

    (@ayteale)

    anyone?

    Try this (just an idea, I will test on my photblog later today):

    <?php
    $content = the_content();
    previous_post('%','$content','yes','no', 1,'');
    ?>

    This assumes that the_content() is outputting:
    '<img src="./photos/image.jpg" />'

    That was me…oops!

    Thread Starter ayteale

    (@ayteale)

    oh oh.! where do I put that code?!!! looks great man!

    Right after the start of the “loop.” Remember, it only works if you have your “content” area of the post as the image tag of your photo.

    Thread Starter ayteale

    (@ayteale)

    cool man..it worked!….it did take me a couple minutes to realize why two of the same photos were coming up…then i deleted the get content code that was already in place 🙂
    there is one wierd thing though…the whole area (story content or whatever) is clickable, not just the photo (vertical is ok, but its clickable horizontaly in the black area)
    Anyway, thanks for your help man!

    Thread Starter ayteale

    (@ayteale)

    Ah! Spoke too soon..when i went to click on a photo in my archive, the photo wouldnt pull up…i need to play with it some more

    Right, all the story content is going to be clickable. The above code works if your content is only the image tag.
    You can always put the image tag in the excerpt field and use this instead:

    <?php
    $content = get_the_excerpt();
    posts_nav_link(' ', '', $content);
    the_content();
    ?>

    Thread Starter ayteale

    (@ayteale)

    well, stupid me, i was putting the coder in your last post in there, hense the wierdness with the whole area being clickable…but anyway, so I put this:
    <?php
    $content = get_the_content();
    posts_nav_link(‘ ‘, ”, $content);
    ?>
    and just the photo is clickable, but like you said, on some of my posts i use the more script to add words or more photos, so it doesnt work (and when i go to a permalink of the photo, the photo doesnt show up)
    Any other ideas anyone?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘click photo to go back…photoblog question’ is closed to new replies.