WordPress.org

Ready to get started?Download WordPress

Forums

Preference Lite
[resolved] Gallery: Full Image Size (7 posts)

  1. AimToChorus
    Member
    Posted 1 year ago #

    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!

  2. StyledThemes
    Member
    Theme Author

    Posted 1 year ago #

    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.

  3. AimToChorus
    Member
    Posted 1 year ago #

    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!

  4. StyledThemes
    Member
    Theme Author

    Posted 1 year ago #

    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:

    <?php
    								$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.

  5. AimToChorus
    Member
    Posted 1 year ago #

    Hi,

    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.

    Thanks!

  6. shinjin
    Member
    Posted 11 months ago #

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

    And Dear StyledThemes
    Member,
    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 ?

  7. StyledThemes
    Member
    Theme Author

    Posted 11 months ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags