• my images are not always in galleries.
    i want to use a lightbox-style plugin to display then when readers click a picture in a post. right now, though, the viewer must click the image, which takes them to the image’s attachment page. THEN, and only then, if they click it again, does it open in the lightbox or whatever plugin I have.

    I want the lightbox to, obviously, open from the first click.

    also, any lightbox plugin recommendations?
    thanks!

Viewing 15 replies - 1 through 15 (of 23 total)
  • You only have to change the link from the images in your posts…
    there are 3 options: no link, attachment page, image url

    Try to chose image url in the image setting inside your post editor ??

    Thread Starter brodyleven

    (@brodyleven)

    thanks for replying

    so, retroactively for my last year of posting (I wasn’t using this plugin until now), I’m sure I don’t have to go back and change every single picture…

    and you’re telling me that people do that with every single picture they post? they change it to “image url”? there must be a way to default to this, and also to do it for all past pictures?

    If you chose it one time, its the default for every next images… but I don’t know a solution for your existing images… ?? maybe a sql batch replacement…

    Try add to your theme image.php file, with this contents:
    <?php wp_redirect(get_permalink($post->post_parent)); ?>

    Thread Starter brodyleven

    (@brodyleven)

    adpawl: thank you, but I don’t know code and am unsure how to do that. can you give me a little more detail? sorry for my ignorance; i’m new and trying to learn.

    Thread Starter brodyleven

    (@brodyleven)

    egado: thank you, it worked! (albeit, only for the one image that I chose it for), however that’s a step in the right direction. thank you! hopefully it defaults that way for future images.

    You must create a image.php file with this contents, then connect to your FTP server and upload the file to wp-content/themes/yourtheme directory.

    Thread Starter brodyleven

    (@brodyleven)

    uh-oh. I have no idea how to do that. if anyone is willing to help me (the only experience i have is going to my custom CSS), I’d appreciate it very much.
    thanks so much.

    Its that simple ?? you wont believe ??

    1. Create the image.php file… nothing in it… (use a code editor)

    2. Put the code from adpawl in your empty image.php
    <?php wp_redirect(get_permalink($post->post_parent)); ?>

    3. …upload the file to wp-content/themes/yourtheme directory…

    thats it…

    Thread Starter brodyleven

    (@brodyleven)

    no way. it worked. i feel like a real web-literate person. thank you, egado and adpawl.

    Thread Starter brodyleven

    (@brodyleven)

    it appears it isn’t working for all of them.
    see:
    https://brodyleven.com/2011/12/08/i-cant-go-to-hawaii-with-nothing-to-do-duh-part-4/

    there’s an old post, where i’d like the shadowbox js plugin that i’m using to open the photos when clicked.

    Thread Starter brodyleven

    (@brodyleven)

    it’s also happening on my about page, here.
    https://brodyleven.com/about/

    Well… this is in couse of the redirect in your image.php – so it works fine (instead of open the attachment page, you will be redirected to the parent post url), but that seems to be not your requested solution

    I will search the web for getting your shadowbox working on your old posts…

    Sorry… I dont found a solution for your problem with the old images… there are only tutorials of how to change the default “image link type” (e.g. https://wptraining.net.au/wordpress-hints-tips/how-to-change-the-wordpress-default-image-link-url/) but in the end of the article you will read this:

    Any NEW images you upload will now have a Default Link value of nothing (i.e. will not be clickable), but any images you have already loaded may still have the original “file” Link value. If you want to change these.you may need to reload the images or manually remove the links.

    No idea, how to change all image link types in your old post to “file”, without updating every post/image by hand.

    ??

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘how to stop images from linking to attachment page?’ is closed to new replies.