Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1221773

    Hello.

    This wonderful slice of code numerically sorts Masonry Gallery images by ‘Title’ :

    function avia_change_posts_query($query, $params){
    if(!empty($query[‘orderby’]) && $query[‘orderby’] == ‘post__in’){
    $query[‘order’] = ‘ASC’;
    $query[‘orderby’] = ‘title’;
    }
    return $query;
    }
    add_filter(‘avia_masonry_entries_query’, ‘avia_change_posts_query’, 10, 2);

    Is it possible that code can sort by Caption rather that Title – I have, predictably, tried to exchange title for excerpt / caption and so forth with no joy so far …

    #1222658

    Is it important for you that the image title has a specific Value?
    My Question: What if the titel is identical to your caption?

    #1222659

    Thanks for your help and support Guenni007 – it is appreciated.

    I actually tried Nextgen gallery a little earlier today and that – after some fiddling – allowed to order by excerpt numerically.

    So I think, I’m away with it!

    #1222777

    Hi joefraser,

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.