-
AuthorPosts
-
July 24, 2023 at 11:11 am #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
SusanneJuly 25, 2023 at 3:52 am #1414297Hey 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,
IsmaelJuly 25, 2023 at 7:33 am #1414309Hi 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
SusanneJuly 25, 2023 at 8:12 am #1414310Hi @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
SusanneTranslated with http://www.DeepL.com/Translator (free version)
July 27, 2023 at 10:05 am #1414636Hi,
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,
IsmaelJuly 29, 2023 at 10:57 am #1414797Hi Ismael,
okay, thanks a lot!. This is how it works now.Many greetings
SusanneJuly 29, 2023 at 7:10 pm #1414843Hi,
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 -
AuthorPosts
- The topic ‘alphabetical sorting of posts’ is closed to new replies.