Move images on the article

by elsoar 20 replies
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
Avatar of Unregistered
  • Profile picture of the author Eric Michalsen
    Did you add the images via the wysiwyg editor, or are the a separate field, independant of the post content?
    {{ DiscussionBoard.errors[11201961].message }}
  • Profile picture of the author Eric Michalsen
    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
    {{ DiscussionBoard.errors[11202206].message }}
  • Profile picture of the author elsoar
    Most amazing !
    {{ DiscussionBoard.errors[11202304].message }}
  • Profile picture of the author Eric Michalsen
    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.
    {{ DiscussionBoard.errors[11202312].message }}
  • Profile picture of the author elsoar
    If the first picture of each post, this gorgeous, enough
    {{ DiscussionBoard.errors[11203104].message }}
  • Profile picture of the author Eric Michalsen
    glad it worked out. learned a lot with this one
    {{ DiscussionBoard.errors[11203124].message }}
    • Profile picture of the author elsoar
      No yet, I have not tried it yet, please send me your latest edit, in ZIP file
      {{ DiscussionBoard.errors[11203170].message }}
  • Profile picture of the author Eric Michalsen
    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!
    {{ DiscussionBoard.errors[11203177].message }}
  • Profile picture of the author elsoar
    What Happen ?
    {{ DiscussionBoard.errors[11203312].message }}
  • Profile picture of the author Eric Michalsen
    looks like a library is not loading.
    I will take a look at this tomorrow
    {{ DiscussionBoard.errors[11203319].message }}
  • Profile picture of the author Eric Michalsen
    can you confirm the file simple_html_dom.php is in the /rearrange/includes/ directory?
    {{ DiscussionBoard.errors[11204573].message }}
  • Profile picture of the author elsoar
    YES
    simple_html_dom.php
    in rearrange/includes
    {{ DiscussionBoard.errors[11204691].message }}
  • Profile picture of the author Eric Michalsen
    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?
    {{ DiscussionBoard.errors[11204757].message }}
    • Profile picture of the author elsoar
      -rw-r--r-- 1 elsoarco elsoarco 63320 Sep 21 11:01 simple_html_dom.php
      {{ DiscussionBoard.errors[11204818].message }}
  • Profile picture of the author Eric Michalsen
    that's a read-only, and you need it to be executable.
    can you change it to 755 (rwxr-xr-x) ?
    {{ DiscussionBoard.errors[11204823].message }}
  • Profile picture of the author Eric Michalsen
    that looks executable.
    are you still getting the same error?
    {{ DiscussionBoard.errors[11204833].message }}
  • Profile picture of the author Eric Michalsen
    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.
    {{ DiscussionBoard.errors[11204844].message }}
Avatar of Unregistered

Trending Topics