Support » Theme: Preference Lite » Gallery: Full Image Size

  • Resolved AimToChorus


    Hi again,

    I set up some galleries using your support forums, very helpful. At the top of each of the galleries it displays a link to view the image in the full size in a new window. Is there a way I can use the advanced text widget or some other code sorcery to get that to not display? The website is for a photography business and I’d rather not let users be able to click there and right click to save the images.

    The website does have a “no right click” plug-in installed, but it doesn’t apply when the image opens in a new window.

    I know it’s a little late, so feel free to respond tomorrow. Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author Styled Themes


    Good morning… ok, you lost me on the “at the top of each of the galleries…a link to view in full size” part. Do you have a link to this gallery of yours where I can see this? I’m not sure what link you are referring to when you have a WP gallery in a page.

    I’ve been tinkering around and discovered that when you set up a gallery you get a choice to link photos to either an attachment page or a media file. When the galleries to link to “attachment page” the photos open on your site with a link to view the full size image on a blank page where anyone can right click and save them. When you set a gallery to link to “media file,” you click the thumbnails and they go right to the full size image on the blank page where anyone can right click/save.

    My question: Is there a way to get the photos to link to the attachment page (so it looks like they’re still on your site) but disable the text that allows them to click on the link to the full size image?

    I’m not really that paranoid about it, but the website isn’t for me. I also like the continuity of keeping the header on all pages rather than a blank one.

    Thanks for the help!

    Theme Author Styled Themes


    In the theme’s image.php file around line 33, you will see this portion of code:

    Image Size: <a href="%3$s" title="Link to full-size image">%4$s × %5$s</a>

    Remove this whole line.

    Again, when making modifications to core theme files, best to use a child theme which I have on my setup tutorials for this theme. But removing that part in the code will take out the link.

    The other part you need to take out is another link further in that file that looks like this:

    <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php			$attachment_size = apply_filters( 'Preference_attachment_size', array( 1170, 1170 ) );								echo wp_get_attachment_image( $post->ID, $attachment_size ); ?></a>

    Replace it with this:

    								$attachment_size = apply_filters( 'Preference_attachment_size', array( 1170, 1170 ) );
    echo wp_get_attachment_image( $post->ID, $attachment_size ); ?>

    IMPORTANT: Make a backup copy of this file first in case something doesn’t go right.


    Sorry for dropping out, had a hectic few days. Came to say that the code worked. I didn’t quite see how the lines worked in wordpress, but when I copied the whole code into dreamweaver, I was able to figure it out.


    Thank you, AimToChorus and StyledThemes
    This topic solved my question!!

    And Dear StyledThemes
    I have a question regarding this change.
    With this solution,
    it removes the function which is
    “clicking an image in a gallery then it moves to another.”
    If you know the code, could you please tell me ?

    Theme Author Styled Themes


    Hi shinjin…probably best to start this as a new topic as the moderators will catch this because the topic is already resolved and you have a new request…one which I have an answer for 🙂

    By the way, glad to hear the other part worked with the code posted from before.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Gallery: Full Image Size’ is closed to new replies.