Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1414201

    Good morning!
    Does anyone have a good idea how I can solve this?

    Amounts for a glossary should be displayed in alphabetical order. Currently the glossary is created with the content element “Magazine”. But neither with this nor with blog posts I can sort it alphabetically …

    Many greetings
    Susanne

    screenshot

    #1414297

    Hey Susanne,

    Thank you for the inquiry.

    To adjust the sorting of the posts in the magazine element, you can add the following filter in the functions.php file.

    /** adjust the magazine element query **/
    function avf_magazine_entries_query_mod($query, $params)
    {
        $query['order'] = 'ASC';
        $query['orderby'] = 'title';
        return $query;
    }
    add_filter('avf_magazine_entries_query','avf_magazine_entries_query_mod', 10, 2);
    

    Please note that this filter will affect all magazine elements in the site. You may need to add conditions if you need to apply the changes to a specific element.

    Best regards,
    Ismael

    #1414309

    Hi Ismael,

    thanks for the info – it works!
    However … I forgot to ask something else. The glossary should be displayed in two columns, because it is so naturally very wide on large screens. Is that possible somehow?

    many greetings
    Susanne

    #1414310

    Hi @Ismael again,

    I have to correct myself. Unfortunately it doesn’t work like that, because then all magazine styles are sorted by date and that can’t be changed.

    Alternatively I could use the content element “blog posts” for glossary? Then I would need the functions code for this.

    Or I create portfolios, but then I’d have to somehow ex- and port lots of drafted blog articles as portfolio posts. I wonder if that would work?

    Many greetings
    Susanne

    Translated with http://www.DeepL.com/Translator (free version)

    #1414636

    Hi,

    Thank you for the update.

    Where can we check the issue? Please provide the login details in the private field. As we mentioned above, if you need to apply the changes to a specific element, you will have to use conditional functions or tags.

    Example:

    /** adjust the magazine element query **/
    function avf_magazine_entries_query_mod($query, $params)
    {
        if(is_page(123))
        {
           $query['order'] = 'ASC';
           $query['orderby'] = 'title';
        }
        return $query;
    }
    add_filter('avf_magazine_entries_query','avf_magazine_entries_query_mod', 10, 2);
    

    The condition mentioned above specifies that the items will be in alphabetical order exclusively when the magazine element is added on the page with the ID 123. Please check the documentation below for more info about conditional tags.

    // https://codex.wordpress.org/Conditional_Tags

    Best regards,
    Ismael

    #1414797

    Hi Ismael,
    okay, thanks a lot!. This is how it works now.

    Many greetings
    Susanne

    #1414843

    Hi,
    Glad Ismael could help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘alphabetical sorting of posts’ is closed to new replies.