WordPress.org

Ready to get started?Download WordPress

Forums

click photo to go back...photoblog question (12 posts)

  1. ayteale
    Member
    Posted 9 years ago #

    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!

  2. chuyskywalker
    Member
    Posted 9 years ago #

    Gonna need a little more info to help ya, bud. What are you using for the photoblog? Where is it located (url)? Etc.

  3. ayteale
    Member
    Posted 9 years ago #

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

  4. ayteale
    Member
    Posted 9 years ago #

    anyone?

  5. Anonymous
    Unregistered
    Posted 9 years ago #

    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" />'

  6. mike
    Member
    Posted 9 years ago #

    That was me...oops!

  7. ayteale
    Member
    Posted 9 years ago #

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

  8. mike
    Member
    Posted 9 years ago #

    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.

  9. ayteale
    Member
    Posted 9 years ago #

    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!

  10. ayteale
    Member
    Posted 9 years ago #

    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

  11. mike
    Member
    Posted 9 years ago #

    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();
    ?>

  12. ayteale
    Member
    Posted 9 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.