Support » Fixing WordPress » Add image links for 700 posts…

  • Hello,

    I just imported the 700+ entries of my photoblog in a wordpress site. Each entry has been converted into a post where the content displays a photo with an <img> tag pointing to a photo. Each post points to a different photo.

    I need to add a link for each image to the original image file.
    I have a few notions of SQL and thought I could write an update query to change each post content and add an <a> tag around the <img> tag. The href portion of the link should be the same text as the src portion of the <img> tag. How can I retreive this part of the post content in a SQL query and change it for each post? Can someone help me with the code?
    If this is too complicated, does anyone know a plugin that could add a link to an image in a post?

    Thank you.

Viewing 1 replies (of 1 total)
  • this is not a WordPress related issue, you may have more luck over at stackoverflow

    the basic idea would be you need to get all posts, then use regex to get the src tag from the img and apply it to a link…

Viewing 1 replies (of 1 total)
  • The topic ‘Add image links for 700 posts…’ is closed to new replies.