Forums

[resolved] Making image from the_content() link to previous post (4 posts)

  1. aminabbasian
    Member
    Posted 1 year ago #

    Hey All,

    Please view: http://www.kittenproductions.com/new/fashion/fashion-image-2/

    Here you will see an image and menu. What I would like to achieve is to make this image clickable and link to the previous post within the category (which in this case is fashion).

    My code is simply:

    <div class="entry-content">
    <?php the_content(); ?>
    </div>

    And the image is loaded Visual box in Edit Post. I have tried a few things but none seem to work properly.

    Please let me know if you have any suggestions.

  2. aminabbasian
    Member
    Posted 1 year ago #

    Anyone with any ideas on this?

    Thanks

  3. aminabbasian
    Member
    Posted 1 year ago #

    ok to give some update on this.

    I found this thread which doesn't work.

    And I know to get the previous post in a category I can use:

    <?php next_post_link('%link', 'Next post in category', TRUE); ?>

    So I still don't know how to link the image within the_content to the previous post. Is there away I can show the content with out using the_content(); tag?

    I've tried to wrap the content with the previous post link but this doesn't work.

    Any ideas?

    Also, if I do get this to work how can I get the last post to link back to the first?!

  4. aminabbasian
    Member
    Posted 1 year ago #

    OK I found a work around for this.

    I've added both:

    <?php previous_post_link('%link', '', TRUE); ?>
    <?php next_post_link('%link', '', TRUE); ?>

    And styled it so that the links over the image with a CSS block. This block is transparent and when hovered over a PNG arrow shows depending on when you wish to click next (positioned to the right) or previous (positioned to the right).

Topic Closed

This topic has been closed to new replies.

About this Topic