• Resolved csjWP

    (@csjwp)


    I want to use either file or file_list to create a css image slider on a front-page.

    But I only know how to do that, if the images are outputted as li elements with an input type="radio".

    Is it possible to modify the function to achieve this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    From the sounds of it, the markup you’re referring to is regarding the frontend when the slider is output. The two field types you mention wouldn’t be holding the markup for that, just an array of file URLs. If you’re storing images, the content would be something like http://www.mydomain.com/wp-content/uploads/2016/09/my-image.png. With that, you could wrap it in whatever markup you want, with a little bit of php to loop over the array.

    $myimages = get_post_meta( get_the_ID(), 'some-key', true );
    foreach ( $myimages as $image ) {
        echo '<li><img src="'. $image . '" alt="" /></li>';
    }
    

    May not be an exact match for how the meta data is stored, but hopefully it gives you an idea of how to go about it.

    Thread Starter csjWP

    (@csjwp)

    Thank you Michael, sounds like what I need. I will give it a go later. But I’m marking it as resolved anyways.

    Thanks.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Change markup from div’ is closed to new replies.