Update images link to their own URL - php

I've recently migrated a blog from Blogger to a fresh WordPress install and all the content was transferred successfully. However, I've noticed all images attached to posts are linked to their original URLs at Blogger.
I'd like to update all images hrefs to their own WordPress URL, but I'm not sure how to do it.
All images are linked like this:
<a href="https://1.bp.blogspot.com/-gZsYD5y6Uyo/WyEjtVFQOgI/AAAAAAAAd74/-73I4Y3OrCEIc7yr4Ca1cmhKrNHqdtjyQCLcBGAs/s1600/Dicas%2Bde%2Bhoteis%2Bem%2Bsetubal.jpg" src="http://example.com/wp-content/uploads/2018/06/Dicasdehoteisemsetubal.jpg"/></a>
And I'd like them to be like this:
<a href="http://example.com/wp-content/uploads/2018/06/Dicasdehoteisemsetubal.jpg" src="http://example.com/wp-content/uploads/2018/06/Dicasdehoteisemsetubal.jpg"/></a>
Can you help me?

Well referencing images on WP can sometimes prove to be trick using their own library as they are not exactly showing the real pathway. you can try as they suggest on codex : Using Images.
Or you can upload the images on a public server like Imgur: https://imgur.com/upload and get the image link for referencing in your code.
Good Luck. :)

You can update the links manually through post editor or use a plugin like velvet-blues-update-urls

Related

Can I add items to the media library of wordpress without upload?

My wordpress site is hosted on the openshift,and when I edit my site's code and push code to openshift,my file that upload to wordpress will be deleted,so I use some public image storage serves to save my image.But there are some function in wordpress must use the media library...So I want to add the image to the media library by url without upload..What should I do?thanks
p.s:I can edit the code of my wordpress site
Try some plugin like this one: https://wordpress.org/plugins/import-external-images/
It's the first i've found, i've never used it before, so look if there's something better.

How to convert all url images in page to media library images in wordpress?

I am really having issue with Conversion of HTML Static Sites to WordPress as images are hosted through HTML SRC Code so after converting it to Wordpress no one is able to see images in Visual Format in Pages during editing so I want to know if there is really any way to convert your whole pages inside images links to media library hosted images so that the person can see the images during editing the page or any alternative solution will be great..!
Image :
In general there's no way to simply paste your code into wordpress and it grab the images for you, unless you're exporting from a previous wordpress installation or something. You'll almost certainly need to import the images maually using the media buttons available in the editor.
There is a plugin that proports to give the option of importing media from static html files, but I have no experience with it.
https://wordpress.org/plugins/import-html-pages/

Wordpress: make a post's video URL accessible from the loop

I'm looking for solution to a particular situation. In my theme each post is on a single page (single.php). Single page has a slider inside of the loop that is populated with attachment images. In that slider, I need to add some videos that are hosted on YouTube.
What I think I need is to write a plugin that allows to add YouTube URLs to a post in UI input fields in post editing window. These links would be then accessed using post id from single.php, so that I could loop through them, using foreach and render them as as html5 video.
I need a general advice on how this can be done. I've got a working slider that needs to host these videos along attachment images, but using attachment video does not work and it doesn't seem to be a viable solution (it's bandwidth intensive).
Any help is appreciated.
Thanks
I've sorted this out using a simpler approach, namely, I've used shortcodes to wrap content that's in the slider. It worked fine and saved plenty of time; it's more intuitive in comparison to using image attachments for creating the content, too.

Fancybox image gallery with ratings and comments

I have a photo website which gathers images from a folder with PHP, displays their thumbnails on a page and, when clicked, opens a fancybox (fancybox.net) to display the full image. I am pretty satisfied with the result but as users start posting, they start asking for new features, and problems come out since I'm not a programmer. What I would like to do is a photo commenting/rating system (like the one on facebook to get the idea, but obviously not as complex): I've been trying to add a Disqus code to each picture, but it won't get displayed in my fancyboxes...So the question is, can you give me any (easy-to-implement) ideas on how to achieve this? I don't mind using already existing softwares like disqus for comments and polldaddy for ratings, since I guess it would require me to setup a mysql database to do it on my own...
To brief it again:
I have a "thumbs" folder which are gathered on a page.
I have an "originals" folder with the full size images that are called back by the fancybox.
I would like to have comments+rating in the fancybox.
Thanks in advance for any advice you can give me.
For your fancybox implementation I'm assuming that it's just pulling the image into the lightbox, not other content (i.e. a html page). What you'd need to do is set up a page which would grab an image, and output it along with your comments + rating code, then set up your script to use that page as the fancybox URL instead of a direct link to the image.
Without more information to go on I can't really help more than that.
ps for comments the Facebook Comments plugin might be easier for a non programmer to implement than Disqus.

How do I make a gallery in WordPress without using a plugin?

I have created a gallery in a WordPress post using WordPress's native media gallery and it shows me the images as gallery thumbnails in rows and columns which is exactly what I want.
But when I click on any of the thumbnail it opens the direct image link. I want that the image should be shown in my blogs environment. I would actually want it to show on the same page itself. but if not that I don't want it to open as a direct image. Is there a template file or something I could make for opening those images. I think image.php, but I have no idea how to go about it.
Help..?
Thanks
When you're inserting a gallery into your post, you can select how to link to the images. See screenshot: http://cl.ly/2yYA
Just select 'attachment page' and you'll get an individual page with commenting for that photo. Is that what you were looking for? You can edit the template of that page using attachment.php.

Categories