
Tagged: ALL button, avia layout builder, customize ALL label, Enfold support, enfold theme, feature request, label override, Localization, masonry element, masonry filter, multilingual support, taxonomy filter, translation, UI customization, user interface, wordpress theme
-
AuthorPosts
-
April 7, 2025 at 2:03 pm #1480929
Hi Enfold Team and community,
I’m using the Masonry element with taxonomy filters via the Avia Layout Builder, and I’ve noticed that the “ALL” label (which appears to show all items) cannot currently be customized or translated from the backend interface.This becomes problematic on multilingual sites or when specific UI wording is needed (e.g., replacing “ALL” with “Everything”, “Tous les articles”, “Overview”, etc.).
I’ve submitted a feature request on GitHub to suggest making this label customizable: 🔗 GitHub Feature Request: https://github.com/KriesiMedia/Enfold-Feature-Requests/issues/132
Feel free to support the idea there if you think it would improve flexibility and localization for your projects too!
Thanks again to the Enfold team for the great work!
Best regards,
ArsèneApril 8, 2025 at 5:36 am #1480969Hey Arsène,
Thank you for the inquiry.
You can use the avf_masonry_sort_first_label filter in the functions.php file to modify the first label of the sorting buttons:
add_filter('avf_masonry_sort_first_label', 'avf_masonry_sort_first_label_mod', 10, 1); function new_portfolio_first_label( $first_item_name ) { $first_item_name = "Everything"; return $first_item_name; }
Let us know the result.
Best regards,
IsmaelApril 8, 2025 at 1:17 pm #1480997I’ve already used this kind of code snippets several times but this works as a generic replacement and it would be way more useful to set a value for each Masonry element as it would allow a contextual “ALL” term usage.
For example on a site I’m currently working on, I’m using masonry elements to display “All discography albums” or “All our artists” or “All musicians”.
Especially in french, the default translation of “ALL” is ‘TOUT’, but this term is only correct for masculine terms and does not work, for example, for “Toutes les images”, since “image” is a feminine noun.
Is there a code snippet that would allow a custom field in the Masonry Element configuration for the “ALL” value of each masonry ?
April 9, 2025 at 4:50 am #1481036Hi,
Yes, you can retrieve the label from a custom field.
add_filter('avf_masonry_sort_first_label', 'avf_masonry_sort_first_label_mod', 10, 1); function avf_masonry_sort_first_label_mod($first_item_name) { $page_id = get_queried_object_id(); $custom_label = get_post_meta($page_id, 'your_custom_field_name', true); $first_item_name = !empty($custom_label) ? $custom_label : 'Everything'; return $first_item_name; }
If you’re using ACF, you can do this:
add_filter('avf_masonry_sort_first_label', 'avf_masonry_sort_first_label_mod', 10, 1); function avf_masonry_sort_first_label_mod($first_item_name) { $page_id = get_queried_object_id(); $custom_label = get_field('custom_label', $page_id); $first_item_name = !empty($custom_label) ? $custom_label : 'Everything'; return $first_item_name; }
You can also extend the filters with native conditional functions or based on the masonry config.
Best regards,
IsmaelApril 11, 2025 at 11:50 am #1481188Wow, thank you Ismael,
I’ll try this ASAP in my child theme functions and get back to you here. Do you think that this custom field might be implemented on a future Enfold update ?In the meantime, I’ll paste your code snippets also on the Github for feature requests here : https://github.com/KriesiMedia/Enfold-Feature-Requests/issues/132
Best regards
April 11, 2025 at 10:29 pm #1481210Hi,
Glad Ismael could help, please follow the Github for feature request that you posted for possible updates about this feature request.
As this is not the correct place for feature requests and you find that this solution is working, we would like to close this thread. OK?Best regards,
MikeApril 12, 2025 at 5:10 pm #1481249Hi Mike, please feel free to close this thread. I updated the Github topic with Ismael’s code snippets as it could help someone else or implementing the feature on a future update.
Best regards
Arsène -
AuthorPosts
- The topic ‘Feature Request – Customize the “ALL” label in Masonry taxonomy filter’ is closed to new replies.