I'm outputting some images using a Matrix field, but they are outputting on frontend in a random order. I'm trying to output according to rows they are currently in.

I tried using sort and orderby Matrix field tags, but no luck.

Here's sample code:

        <li><img src="{image}" alt="{title}" /></li>

Ended up being a js issue with the flexslider script.

This wasn't working:

        $(window).load(function() {
                animation: "slide"

Replaced with this and worked:

            animation: "slide",
            start: function(slider){

1 Answer 1


Strange that you're getting a random output since orderby="id" is the default. Are you sure there isn't some kind of JavaScript that's reordering your fields on the front-end? You could try disabling JavaScript to verify that.

Otherwise you could try explicitly setting the id field as the orderby (which I've never had to do before).

{homepage_sliders orderby="id"}

but it definitely seems wrong.

There's also the fixed_order="" parameter which let's you specify the order of the ids

{homepage_sliders fixed_order="1|3|2|4"}
  • Definitely strange. Jarrett, you were on the right track with the js error. It was actually an issue with the flexslider script. Included my answer above. Thanks for the help.
    – frshjb373
    Commented Nov 21, 2014 at 23:21
  • Had a similar issue on a site I built in 2013 and needed to update & it turned out to be exactly this. Thanks guys, saved me a lot of debugging time.
    – StvCummins
    Commented Dec 18, 2015 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.