• Resolved Tekeli24

    (@tekeli24)


    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.

    THAT CODE:
    <?php wp_redirect(get_permalink($post->post_parent)); ?>
    Code is IN MY IMAGE.php :
    ….
    $metadata[‘width’],
    $metadata[‘height’],
    esc_url( get_permalink( $post->post_parent ) ),
    get_the_title( $post->post_parent )
    );

    edit_post_link( __( ‘Edit’, ‘sugarspice’ ), ‘<span class=”edit-link”>’, ‘</span>’ );

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Tekeli24

    (@tekeli24)

    Anyone to help???

    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>
    Thread Starter Tekeli24

    (@tekeli24)

    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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Deactiveting post images goes to picture's page on homepage’ is closed to new replies.