• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Can I set/edit a default link for an image in media lib?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Can I set/edit a default link for an image in media lib?

This topic is: not resolved

Tagged: image link

  • This topic has 9 replies, 3 voices, and was last updated 12 years, 4 months ago by essaysnark.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • April 26, 2014 at 10:08 am #102439
    dev
    Participant

    I uploaded to Media Library a plain old Amazon "buy" button.

    I did not set a 'custom link' at that time. I set it to 'none.'

    I inserted the button on a bunch of pages... a lot of them... and set the link to the page on Amazon I want to go to if clicked.

    Now I find I have to change the link and the only way I know is to go to EVERY page and edit that button-image.

    Is there any way to set a 'default' link to an image button... set it once globally?

    A plugin or PHP code in functions?

    It would save me a ton of time?

    Thanks.

    April 26, 2014 at 11:01 am #102453
    AnitaC
    Keymaster

    I use this plugin for most of my website development project.


    Need help with customization or troubleshooting? Reach out to me.

    April 26, 2014 at 11:32 am #102470
    dev
    Participant

    The plugin only works with a gallery, as I understand it. And with 3.9 who knows were galleries have gone to?

    I have these Amazon buttons insered in lots of pages and sidebars (at bottom) and if I throw in a [gallery] shortcode it works but it kind of throws off the spacing and I think I'd have to put in a ton of CSS to align it right. And besides, I would have to put in the short code on every page. If I'm going to do that I may as well just edit each Amazon button!

    Do you have stronger magic for me?

    Thanks.

    April 26, 2014 at 11:35 am #102471
    AnitaC
    Keymaster

    I've used that on individual images. So I am not sure what you read - but if you install it and then look at an individual image - you will see "Gallery Image" and where to place the URL. You don't have to have a gallery for that to work. They probably should change that name on there.

    That's about all I have. Maybe someone else has a better way.


    Need help with customization or troubleshooting? Reach out to me.

    April 26, 2014 at 12:50 pm #102489
    dev
    Participant

    I don't think it works with 3.9 (at least not with the old Agency theme)

    I edit the image in Media Lib. and add the Gallery Link.

    Using Insert Media I put the pix into my page.

    When I go to 'edit' pix, none of the plugin add-on areas are shown (under advanced)

    I think it has something to do with the new media editing stuff that WP put in for 3.9.

    It only works if I put in a [gallery] shortcode in the page... which is what I don't want to do.

    Thanks anyway.

    April 27, 2014 at 8:31 am #102586
    essaysnark
    Participant

    This is definitely stronger magic:

    https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    April 27, 2014 at 1:55 pm #102637
    dev
    Participant

    This is a well-known tool and I use it when migrating WP sites from one domain to another.

    But if you have a image button (i.e. Buy from Amazon) on the site now and it is NOT linked... what would you search and replace?

    I've looked high and low and can't find a solution. I'm going to have to go into every page and change (edit) each button with the link to the Amazon page. It's not that big a deal... but I was hoping to find a better solution.

    April 27, 2014 at 2:07 pm #102638
    essaysnark
    Participant

    Why can't you search/replace the entire img src block? If it's not linked now, then just add the full anchor tag in the 'replace' part. Not seeing why that wouldn't work.

    April 27, 2014 at 2:24 pm #102639
    dev
    Participant

    I dumped the database and did a search on "amazon'. Here is a slice of the output:

    
    sed.\r\n\r\n&nbsp;\r\n\r\n<img src="http://buildwealthandspenditall.com/wp/wp-content/uploads/smashword.png" alt="smashword" width="126" height="40" />\r\n\r\n<img src="http://buildwealthandspenditall.com/wp/wp-content/uploads/amazon.png" alt="amazon" width="120" height="42" />','default-sidebar','','inherit','open','open','','58-revision-v1','','','2014-04-26 05:40:35','2014-04-26 
    
    

    perhpas if I replaced:

    src=\"http://buildwealthandspenditall.com/wp/wp-content/uploads/amazon.png

    and put an href in there...

    it might work. Or I'd screw up the database! (Yeah, keep a copy!)

    The way that WP serializes it's data in the database, you are just asking for problems messing with it externally.

    April 27, 2014 at 2:42 pm #102640
    essaysnark
    Participant

    The way that WP serializes it’s data in the database, you are just asking for problems messing with it externally.

    Which is the whole point of that tool that I linked to.

  • Author
    Posts
Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble