-
AuthorPosts
-
October 6, 2013 at 4:24 am #170992
There was another thread on this that has been closed : https://kriesi.at/support/topic/accordion-hide-all-category/#post-133938
Finally got around to trying Kriesi’s advice, but it didn’t work :( I think perhaps because of the 2.3 update?
In any case, I’ve pasted the following function into my child theme’s functions.php, but I might have missed something.
Any thoughts?
October 7, 2013 at 7:11 am #171476Hi Michae1!
The filter on thread is for the portfolio sort. You can change the “All” text for the accordion element by editing config-templatebuilder > avia-shortcodes.php > toggles.php. Find this code on line 233:
$tag_string = "{".__('All','avia_framework' )."} ";
Best regards,
IsmaelOctober 7, 2013 at 8:42 am #171493Hi Ismael,
Thanx. I’ve changed that already. But Kriesi had a dynamic fixed in the thread above that I could use in my child theme functions.php, so it wouldn’t revert back with every new update. However, that didn’t seem to work properly, likely because of the latest 2.3 update. Was hoping for a similar fix if possible.
Thanx
– MichaelOctober 8, 2013 at 11:04 am #172139Hello!
Please try following code instead
add_filter('avf_portfolio_sort_first_label','avia_change_label', 10, 2); function avia_change_label($all, $params) { $all = "Name of your label"; return $all; }
and replace “Name of your label” with your custom text.
Cheers!
PeterOctober 19, 2013 at 7:11 am #177747Hi Dude,
I tried your code, but it didn’t seem to work. This is exactly what I have placed in my child themes functions.php
<?php add_filter('avf_portfolio_sort_first_label','avia_change_label', 10, 2); function avia_change_label($all, $params) { $all = "Name of your label"; return $all; }
The “General Questions” (which I hardcode renamed in the php from “all”) is the one that SHOULD be changing with this function.
http://bit.ly/1bBpSLcWhat am I doing wrong?
October 20, 2013 at 8:33 am #178009Hey!
I just noticed that Kriesi did not add the filter to the accordion function but it will only affect the portfolio filter. I’ll ask him to add it to the accordion function too.For now you need to modify /wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/toggles.php directly and replace following line
$start = array(__('All','avia_framework' ) => true);
with
$start = array();
Regards,
PeterOctober 21, 2013 at 4:09 am #178246So, I’m definitely doing SOMETHING wrong, because replacing the above code caused the entire body of the page to not render :(
October 23, 2013 at 10:24 am #179569Hey!
Please update to the latest version of Enfold (released yesterday) and add following code to the functions.php file to change the label:
add_filter('avf_toggle_sort_first_label','avia_change_toggle_label', 10, 2); function avia_change_toggle_label($all, $params) { $all = "Name of your label"; return $all; }
Cheers!
PeterOctober 29, 2013 at 5:00 am #181924Hi Peter, that worked great! Thanx!!
Is there a similar hook for the separator? I’d like to change it from “/” to “|” and change the color. Hope so :)
October 29, 2013 at 10:06 am #181970Hey!
I did not test it but you can try to overwrite the default separator with following css code
#js_sort_items .text-sep:after { content: "|"; } #js_sort_items .text-sep{ display: none; }
Insert it into the quick css field.
Regards,
PeterOctober 31, 2013 at 5:01 am #182813No luck there, Peter. Any other thoughts? I also tried adding !important, just in case that might override the setting. I was thinking, because this is a character and not just a style change, wouldn’t it have to be changed in the php too, like the above “All” label?
November 1, 2013 at 3:55 am #183256Hey!
There is no filter for the seperator. You need to manually edit the file again and look for this code on line 269:
$output .= "<span class='tag-seperator'>/</span>";
Best regards,
IsmaelNovember 27, 2013 at 1:59 am #193653Thanx Ismael. Was hoping for a dynamic solution so my client wouldn’t have to change this in the php every time they update.
Could you point me in the right direction of adding a function to my child functions.php that might do this?
Was trying to look around for how/where the “All” tag is able to be changed dynamically with Peter’s function. Couldn’t I adapt that function to do the same thing for the separator?
November 27, 2013 at 5:55 am #193696Hi!
I’m not sure if this is possible with a child theme. I’ll ask Dude.
Best regards,
IsmaelNovember 27, 2013 at 7:51 am #193741Cool. Thank you, Ismael. Look forward to hearing the solution.
November 27, 2013 at 9:29 am #193759Hi!
The only way to change the separator with a child theme would be to overwrite the entire portfolio shortcode file. Crreate a “shortcodes” folder within the child theme directory, then copy the /wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/portfolio.php into the child theme “shortcodes” folder and modify the code based on Ismaels instructions (see last post). Then add following code into the child theme functions.php file
add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
It will make sure the the shortcode file of the child theme is loaded first and you can overwrite the parent theme files.
Best regards,
Peter -
AuthorPosts
- The topic ‘Customize Accordion Sortable "All" Tag’ is closed to new replies.