WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Code for rotating image widget (13 posts)

  1. jwillua
    Member
    Posted 4 years ago #

    I am using a widget called "rotating image widget" for a slideshow in my sidebar. It pulls images from recent blog posts. I would like to change the source to pull images from a specified folder that contains images not necessarily used in blog posts. I can not find the file to edit and get this done. Thanks for any help.

    Or is there a better widget to do this? a simple slideshow will do.

    Thanks.

  2. jwillua
    Member
    Posted 4 years ago #

    does anybody know where this code might be located? I know its simple but i'm still trying to get better at WP. Thanks for the help.

  3. Mark / t31os
    Moderator
    Posted 4 years ago #

    You could start by providing a link to the widget in question... :)

  4. jwillua
    Member
    Posted 4 years ago #

    Sorry, here is the link, http://wordpress.org/extend/plugins/rotating-image-widget/

    I guess a better question would be, what would you use to insert a slideshow into a sidebar? Nothing fancy just slideshow of some pics from a specified folder.

    Thanks.

  5. Mark / t31os
    Moderator
    Posted 4 years ago #

    Probably a standalone image rotation script, but if you like this particular script i think it could be modified to use a folder instead, it's a matter of switching a query for posts to a piece of code that reads a folder..

    There's tons of image rotation scripts around though, usually for doing just as you say above, select images from a folder. If the slider code is independant from the plugin then sure a standalone script would be fine, otherwise the plugin route might be easier...

    Well whatever you decide, if you need help, feel free to ask... :)

  6. jwillua
    Member
    Posted 4 years ago #

    Might you point me to a stand alone rotation script example? :) I assume you mean HTML script that can be put into a standard widget? Thanks for the response, i get better everyday at this WP stuff. Thanks. I think the plugin i am using is probably not the best for me.

  7. Mark / t31os
    Moderator
    Posted 4 years ago #

    You'd still need PHP, so i'd probably suggest you register your image rotation script as a widget, you'd then just add the widget to your sidebar via Admin > Themes > Widgets, like any other widget.

    For a script, there's lots to choose from.
    http://www.google.co.uk/search?q=php+images+from+folder

    Aim for something small, complex scripts are unnecessary for grabbing images from a folder. To illustrate keeping it simple, grabbing a list of files in a directory...
    http://www.w3schools.com/php/func_directory_scandir.asp

  8. jwillua
    Member
    Posted 4 years ago #

    This seems amazingly simple, http://analysisandreview.com/wordpress/image-rotation-script-for-wordpress/ , even has a PHP file yet i try and it won't work. Thanks for the links, i will continue to try, i thought this might be simple ha. The link above sounds perfect but just can't get it to work.

  9. jwillua
    Member
    Posted 4 years ago #

    One more question, how do i reference the php file from the text widget? For instance i can create a php file using this, http://www.phpsnaps.com/snaps/view/php-image-slideshow-auto/ , i then upload it but how do i tell wordpress where i want the slideshow to appear? Thanks for the help.

  10. jwillua
    Member
    Posted 4 years ago #

    basically, how do you do step #6? Thanks

  11. Mark / t31os
    Moderator
    Posted 4 years ago #

    Managed to spare a few moments to try a quick mod to the plugin..
    http://wordpress.pastebin.com/g90AhVVv

    All you'd need do is open wp-content/plugins/rotating-image-widget/includes/core.php and replace the get_images() function with the one provided above..

    Setup to look in the theme's folder for a directory called images, but you can see the part i've modified, also supports the uploads directory (the commented out parts).

    Regarding the code above, you'd still need to register the code inside a widget, and i'd guess it'll be a little more tricky then my mod above.

  12. rodwreck
    Member
    Posted 4 years ago #

    Managed to spare a few moments to try a quick mod to the plugin..
    http://wordpress.pastebin.com/g90AhVVv

    All you'd need do is open wp-content/plugins/rotating-image-widget/includes/core.php and replace the get_images() function with the one provided above..

    Setup to look in the theme's folder for a directory called images, but you can see the part i've modified, also supports the uploads directory (the commented out parts).

    Regarding the code above, you'd still need to register the code inside a widget, and i'd guess it'll be a little more tricky then my mod above.

    Hey man this works perfectly thanks t31os_

  13. Mark / t31os
    Moderator
    Posted 4 years ago #

    You're welcome.. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.