Support » Fixing WordPress » Disable image from linking on single post page

  • I add a new image to each post. On my index page, each image links to its respective full post. When I’m viewing a post page, the image links to the page I’m already on.

    I don’t want the image to have an <a> tag around it when I’m already on the page it links to. Is it possible to disable the link around the image when on a single post page without using the_excerpt instead of the_content on the index page?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Click the “Edit” button on the image, then remove the URL (auto-populated by default) from the “Link URL”. This should prevent the image from linking from the single post view.

    You might be better off using the Set thumbnail option in Admin/Edit Post under the Post Thumbnail tag and then editing your theme to support and use post_thumbnail.

    pwhitene,

    It does, but I want the image to link to the post if I’m on the index page. The link around the image should only be removed when viewing the single post page.

    esmi,

    How can post_thumbnail be used to add a link to the post around the post’s image on the homepage, but remove that link around the image when on a single post page?

    Because post_thumbnail pulls an entirely separate image. So you can leave the image that’s within the post content unlinked.

    Thanks, esmi. I got it working. My only problem now is that for posts with a post thumbnail, the thumbnail automatically gets added to the bottom of my post, even though there’s no code in my single page calling it to show up there.

    How can I remove this? I just want it above my post text where I added the code for it.

    What’s the URL for the site in question?

    It’s on my local server, not online yet.

    It appears the problem with post-thumbnails is that it automatically inserts the thumbnail below the_content on a post page, which isn’t where I want it to appear.

    No it doesn’t! I’m working on a theme that makes extensive use of post_thumbnail and I’m not getting any auto-insertion of the thumbnail on the single post page.

    As soon as I add

    add_theme_support('post-thumbnails');

    to functions.php, the post thumbnail is automatically added below the content of a post, if the post has a thumbnail, even before editing single.php.

    I have no idea why. Any ideas?

    If it’s being added in the single post view, check single.php for the_post_thumbnail() and remove it.

    I did, it was never in there to begin with. Once I add it in, the image shows up where I want it to, but shows up again after the content of the post, and it’s no where in the code.

    I’m using the new post_thumbnail feature as well and am not having any issues. I’ll need to see your site in order to diagnose further…

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Disable image from linking on single post page’ is closed to new replies.