Support

Account

Home Forums Feature Requests Reverse Order button for the Repeater plugin

Solving

Reverse Order button for the Repeater plugin

  • FEATURE REQUEST: Reverse Order button for the Repeater plugin

    I am using the Repeater plugin to add photos to a web page

    I upload the photos into the WP Media Library first. Then in my post, in the custom fields (with repeater field) I use Add Image to select all of the images I’ve uploaded and add them. All the repeated rows are then added, one for each photo (this could be around 100 images so saves a lot of time this way). But now the photos are ‘upside down’ – eg newest at the top, which is the opposite way around that I want to use for my blog.

    To fix this, I’ve added an additional checkbox to reverse the order with PHP on the front-end. But it would be far nicer if the plugin had a button next to the fields in the backend to do this there.

  • Hi @joesmalley

    May I ask why you’re not simply using the gallery field instead? It’s pretty much the same for output but you get a nice UI with easier drag’n’drop for reordering your images.

  • Thanks for the heads-up on the Gallery field Jonathan, but my website’s gallery is quite complex, requiring a few checkbox custom fields to control things like cropping for each image. Hence why I’m using the Repeater plugin.

  • Okay I see..

    I think this would be a feature pretty much noone uses tho. And you can easily achieve a reverse order yourself with just:

    
    $repeater = get_field('fieldname');
    if( $repeater ){
    
    $reversed = array_reverse($repeater);
    
    foreach( $reversed as $imagerow ){
    
    }
    
    }
    
    
  • Within the foreach, how do I access the_sub_field(‘foo’)?

Viewing 5 posts - 1 through 5 (of 5 total)

The topic ‘Reverse Order button for the Repeater plugin’ is closed to new replies.