WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Tekeli24
    Member
    Posted 2 months 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.

    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>' );
    ...

  2. Tekeli24
    Member
    Posted 2 months ago #

    Anyone to help???

  3. LWA
    Member
    Posted 2 months 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
    Member
    Posted 2 months 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

Reply

You must log in to post.

About this Theme

About this Topic