Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #1220895

    Hi guys,
    couldn’t find a solution to this …

    Is there a way of showing / displaying images in a numerical order? … as in:

    Filename: xyz
    Description: 1

    Then that image would display before 2, 3, 4 and so on.

    #1220967

    Hey joefraser,

    Are you using masonry gallery?

    Best regards,
    Jordan Shannon

    #1220975

    Hi Jordan – yes, I am currently using the Masonry Gallery so it would be handy to find a fix for that in particular.

    #1220987

    Hi,

    Edit Masonry Gallery and click on Add/Edit Gallery button then drag and drop images in the order that you want.

    Best regards,
    Jordan Shannon

    #1221021

    I appreciate that – but the client wanted to add images and label them and have the site order automatically, irrespective of their position in the gallery back-end (so to speak).

    Probably needs coding separately.

    #1221028

    you can try that filter – put this to your child-theme functions.php

    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);

    i do not know how it is reacting on “load more” Galleries.

    #1221031

    by the way – dear mods: how can i use this only for a specific page ?

    #1221168

    Wonderful – thank you very much; this worked.

    Aye, not sure how load more might work but this opens the door etc,

    #1221216

    it works ! i tested it afterwards

    But indeed i like to know how the syntax might be if i only want to have it on a given page.

    #1221258

    I think a mod. could solve that – it’s likely possible with a $query / page ID combo …

    #1221392

    Guenni007 … you wouldn’t happen to know how to sort by ‘excerpt’ rather than ‘title’ … so it’s this code I assume, just more excerpty ;)

    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);

    #1221493

    But you are talking about an image gallery?
    Or have you an masonry_entries ( a blog or portfolio etc )

    #1221745

    The code worked perfectly to numerically order ‘Masonry Gallery’ images … but by the ‘title’ information.

    Typically, the client wanted to sort by the ‘excerpt’ information. Each Masonry Gallery image can have a title and a caption/excerpt.

    #1221753

    these are parameters to wp_query: https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters
    so i guess no direct chance to have it here

    #1221767

    Thanks for that Guenni007 … no joy … I’m going to attempt another thread to collar a mod response …

    #1222151

    Hi joefraser,

    According to the docs, there is no such option to sort by the image caption. So we cannot really provide you such an option.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1222384

    OK Victoria – thank you anyway.

    #1222568

    if you realy need this i do only see for now a plugin solution. There are a lot of good – especially for fotographers – that have this option on sorting by caption.
    See Envira or NextGen Gallery

    #1222714

    Hi Guenni007,

    Thank you for your suggestion :)


    @joefraser
    You might want to consider using one of the plugins suggested by Guenni007.

    Best regards,
    Victoria

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