hi Support,
we use the function to replace the Label “all” in our masonry. We use more than one masonry in our theme. How can we change the label only for the special mesonry element?
add_filter(‘avf_masonry_sort_first_label’,’new_masonry_first_label’);
function new_masonry_first_label() {
$first_item_name = “NEW ALL TEXT “;
return $first_item_name;
}
Thanks for your help!
Best regards!
Tobias
Hi Tobias,
I’m not really sure what you meant by special masonry element, however, you can use WordPress Conditional Tags to point to a specific page. https://codex.wordpress.org/Conditional_Tags
Hope it helps.
Best regards,
Nikko
Hi Nikko,
thanks for your answer – please help me a little bit more – i´m not a php profi.
How can i do this on special page id?
Thanks a lot!
Best regards!
Tobias
can you try this:
add_filter("avf_masonry_sort_first_label", function($first_item_name) {
if(is_page(2623)) {
$first_item_name = "ABC";
}
if(is_page(array( 123, 38147 ))){
$first_item_name = "DEF";
}
return $first_item_name;
}, 10, 1);
ID’s without quotation marks – page-names with
Vielen herzlichen Dank Günni!
Beste Grüße
Tobias