WP 2.9 image insertion no longer allows url to off site resource (46 posts)

  1. nbseminary
    Posted 6 years ago #

    I too am struggling with this - particularly when inserting a gallery using the shortcode. There is no html to delete.

  2. ianatkins
    Posted 6 years ago #

    I too have this issue. The 'Link URL' is not saved when clicking save all changes.

    I need to access the URL via templates. I'm not even sure 'Link URL' is being inserted into the database. Is it just used for the insert into post link?

  3. Mindshare Labs, Inc.
    Posted 6 years ago #

    Bad news - I'm running WP 3.0 and I'm STILL having this issue. Tried deactivating all plugins and everything. It is really lame for something this major to go unfixed in a release as monumental as 3.0!

  4. rogermh
    Posted 6 years ago #

    I guess that's not too surprising since the developers think that the bug has been fixed: http://core.trac.wordpress.org/ticket/12315

    I think the thing to do would be to re-open the bug. Unfortunately, I don't know how to do that. Anybody know how?

  5. venedictus
    Posted 6 years ago #

    Im so surprised to know that a feature as important as this will be left undone until now.

    Im faced into doing a project that will make use of the gallery feature of wordpress to showcase images and videos as well. They are supposed to be viewed better using a lightbox, but since I cannot put the proper links for the videos this is a big problem. And its worse knowing that even version Thelonious still inherits this problem.

    I hope someone figures a workaround for this.

  6. rogermh
    Posted 6 years ago #

    I reopened the bug on this. It was actually pretty easy - the forums and the Trac site use the same logins.

    venedictus, it sounds like we both want to do the same thing. I have proposed it as an idea here: http://wordpress.org/extend/ideas/topic/mixed-media-galleries

    Please go to the link above and vote for this idea to encourage the developers to add it to the WP core!

  7. venedictus
    Posted 6 years ago #

    Thats a great idea rogermh, I already voted. :)

    I really needed this functionality now so Im afraid I cannot wait anymore till the developers implement this so I made a solution for myself. And hopefully you guys can make use of this too.

    Basically what I did was to make use of the Description meta data for placing my custom URL instead of the Link URL since its not going to save any link you put there anyway. Not until the developers do something about this. So maybe for now we can use this as a simple workaround.

    Simply put this code into your functions.php

    // Custom Gallery
    function custom_gallery() {
    	$args = array(
    		'post_type' => 'attachment',
    		'numberposts' => -1,
    		'post_status' => null,
    		'post_parent' => get_the_id()
    	$attachments = get_posts($args);
    	if ($attachments) :
            echo '<div class="gallery-' . get_the_id() . '">';
    			foreach ($attachments as $attachment) {
    				echo '<div class="gallery-item">';
    				$attachment = get_post( $attachment->ID );
    				if ($attachment->post_content == '') :
    					$attachment_url = $attachment->guid;
    				else :
    					$attachment_url = $attachment->post_content;
    					echo '<a rel="shadowbox[album-' . get_the_id() . '];" href="' . $attachment_url . '">';
    					echo wp_get_attachment_image($attachment->ID, $size='thumbnail', $icon = false);
    					echo '</a>';
    				echo '</div><!--.gallery-item-->';
    		echo '</div><!--.gallery-' . get_the_id() . '-->';
    add_shortcode('custom-gallery', 'custom_gallery');

    Now this will work by typing the shortcode [custom-gallery] into your post editor.

    If you want to use this in your theme you can simply put the following code and it will also work as long as its inside the loop where $post->ID is available.

    <?php echo do_shortcode('[custom-gallery]'); ?>

    And now you can give your images custom URLs so you can link them to other sites or videos or anything. Just put the link in the Description field and save. When left blank your image will be linked to the attachment file.

    Im using the shadowbox-js plugin in my gallery because it supports a wide variety of media. Try this together with the code I provided and you can be able to view images and videos from youtube or vimeo while browsing your galleries.

    Look for this code and delete it if you're not going to use it. Although its fine if you just leave it.

    rel="shadowbox[album-' . get_the_id() . '];"

    You can also assign custom thumbnail sizes. Just look for the word thumbnail in the code and replace it with your custom thumbnail size. You can refer to this tutorial for further understanding about custom thumbnails.

    I hope this helps. :)

  8. venedictus
    Posted 6 years ago #

    When you want to use it in you theme, you might want to use this code:

    <?php custom_gallery(); ?>

    instead of:

    <?php echo do_shortcode('[custom-gallery]'); ?>

    which is mentioned above. Either way, they will produce the same output.

  9. Mezloh
    Posted 6 years ago #

    The only way I was able to get around this problem is to delete the a rel="attachment wp-att-6034" and then overwrite the image url with my external link in the html editor.

    I was having the exact same problems as everyone else in this thread with the external urls reverting back to the image url when saving.

    I was really surprised to see this problem pop up with the newest version of wordpress.

    External linking in images is such a common practice. I have uploaded banners and images extensively in posts and pages the past 5 years and this is the first time it has ever been a problem.

    I am just glad I got my external links to work, I hope all of you get your issues worked out!

  10. hanheg
    Posted 6 years ago #

    just to confirm, the same problem still exists in 3.0. The link url is not saved in the "add image" screen.

  11. crazeann
    Posted 6 years ago #

    Try this guys....
    in the HTML tab, change to code to this
    [gallery column="4"]

    i have tried this to my 2 wp website...and it works....
    the number above, i thinks should be relative to our column.

  12. rogermh
    Posted 6 years ago #

    crazeann, just to confirm, are you saying that when you change the code in the HTML to [gallery column="4"], WP properly saves the URL you enter into the "Link URL" field? I tried that and it didn't work for me on 3.0.1.

    BTW, one of the developers responded to the bug but wanted more clarification. I've provided that; hopefully it's sufficient.

  13. crazeann
    Posted 6 years ago #

    Here is what i've done :
    After click SAVE CHANGES in Setting-Media ( without change anything in Setting- Media), i go to EditPage, alter the media, click Post Url, the link changes, but when click save changes, it reverts back with jpg/image link.
    Then i try to change in HTML tab from
    [gallery link="file"]

    [gallery column="4"]

    And the url images work smoothly...

    Note that i use the wp v3.01

    Hopes it helps :D :D

  14. mazzthepianoman
    Posted 5 years ago #

    3+ months and no resolution? This does not make the fact that I wasted over 2 hours because of this bug any easier....

  15. Carl
    Posted 5 years ago #

    Has this been fixed? I'm still experiencing this issue.

  16. circuitor
    Posted 5 years ago #

    In case anyone is looking for it, the bug trac on this issue has been changed.
    See current bug report here:

Topic Closed

This topic has been closed to new replies.

About this Topic