Sugar and Spice
[resolved] Deactiveting post images goes to picture's page on homepage (4 posts)

  1. Tekeli24
    Posted 2 years ago #

    Hi Alexa and everyone,

    When I click any a image on my homepage in any post it goes that image's page and shows just image. I want to change this function with like continue reading. So when I clicked to image, it'll go to releated post.

    I found a code for this function.But I couldn't replace it correctly.
    Because there is some nearly same codes and I think they are crashing when I replaced it in image.php file.Can you tell me how should I replace it for as I told and useable for most using pages like home,category page,author page.

    <?php wp_redirect(get_permalink($post->post_parent)); ?>
    Code is IN MY IMAGE.php :
    esc_url( get_permalink( $post->post_parent ) ),
    get_the_title( $post->post_parent )

    edit_post_link( __( 'Edit', 'sugarspice' ), '<span class="edit-link">', '</span>' );

  2. Tekeli24
    Posted 2 years ago #

    Anyone to help???

  3. LWA
    Posted 2 years ago #

    Are you wanting the image to act as a hot link to the article to be read?

    If so just add this code

    <a href="the url you want to link to"><img src="the image url" /></a>
  4. Tekeli24
    Posted 2 years ago #

    I solved it without any code replacing. That's my fault.
    I changed all post's pictures link to reletad posts from media library :)
    Thanks again

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic