Move images on the article

by 20 replies
23
hello all of you. I have an issue, I have a WordPress blog, each post have one image "sometimes more", All images in the beginning of the post.
Now, I want move all images from the beginning to the end of the post! Is I can do that automatic or with a plugin without edit all posts Manually?
#website design #article #images #move
  • Did you add the images via the wysiwyg editor, or are the a separate field, independant of the post content?
    • [1] reply
  • cool...I was playing with some ideas this morning on a plugin which moves the images, front to back, and back to front.
    I'll post to github if I get it running smoothly.

    Ok, started to play with an idea over lunch that basically looks at each post, extracts the image, cleans the post of all images, then sets the image to the end.

    The plugin is NOT operational yet, but was unsure of your development chops, if am posting to see if you want to continue on. I won't be able to come back to this until tomorrow.

    As preg_match() is problematic with image tags, I'm using the simpleDOM library, and it seems to be working ok.

    https://github.com/michalsen/rearrange

    edit: I have it working, at least from a very limited test env
  • Most amazing !
  • Thank you.
    Can NOT stress enough, not for production sites. Currently (I believe) it only works with one image, and I'm not sure how nice it will play with WP if the posts are large

    btw, this only does one image per post.
    if I can get some time at lunch today I'll take a look at seeing if it can do multiple images.
  • If the first picture of each post, this gorgeous, enough
  • glad it worked out. learned a lot with this one
    • [1] reply
    • No yet, I have not tried it yet, please send me your latest edit, in ZIP file
  • it's up on github:
    https://github.com/michalsen/rearrange

    remember, don't use this on a production site! test on a local site, and if you do turn this plugin on, on a production site, back up that database!
  • What Happen ?
  • looks like a library is not loading.
    I will take a look at this tomorrow
    • [ 1 ] Thanks
  • can you confirm the file simple_html_dom.php is in the /rearrange/includes/ directory?
  • YES
    in rearrange/includes
  • can you confirm those warnings that the path is correct, and that the file is executable by your webserver? if you were to do an ls -l simple_html_dom.php in the includes directory, what is the result?
    • [1] reply
    • -rw-r--r-- 1 elsoarco elsoarco 63320 Sep 21 11:01 simple_html_dom.php
  • that's a read-only, and you need it to be executable.
    can you change it to 755 (rwxr-xr-x) ?
    • [2] replies
  • that looks executable.
    are you still getting the same error?
  • and you have confirmed that exact directory location in your error with that of the file....it does really exist in that directory?

    I am working off the theory that the path and file in the error match exactly with the true path of the file.
    Also, the directories have the proper permissions for the webserver?

    Can you spin up a local instance of your WP site and run it there, so that you have control over the site? As per the README.md, you should NOT be running this on production anyway.

    Grab a copy of scotchbox and spool up an instance, install the plugin. If it works on the local, do an export/import of your posts and run a trial to make sure the plugin does what you need it to.

Next Topics on Trending Feed

  • 23

    hello all of you. I have an issue, I have a WordPress blog, each post have one image "sometimes more", All images in the beginning of the post. Now, I want move all images from the beginning to the end of the post! Is I can do that automatic or with a plugin without edit all posts Manually?