Tagged: customize, Fullwidth sub menu, Language
-
AuthorPosts
-
October 18, 2021 at 12:30 pm #1325404
Hello!
When the Fullwidth Sub menu get into a icon with the text “Menu” on for example smaller displays, i haven´t found a possibility to change the Menu text into another language or custom text.
How can i do? Is there a custom css code i may can use?October 18, 2021 at 5:05 pm #1325460Hey,
Thanks for contacting us!
You can use – https://wordpress.org/plugins/loco-translate/ plugin to translate it to another language.
If you would like to change the text on your child theme ( https://kriesi.at/documentation/enfold/child-theme/ ), please copy /enfold/config-templatebuilder/avia-shortcodes/menu/menu.php file to your child theme into /shortcodes/ folder and find
$mobile_button .= '<span class="av-current-placeholder">' . __( 'Menu', 'avia_framework' ) . '</span>';
Then add following code to bottom of Functions.php file of your child theme
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; }
Best regards,
YigitDecember 17, 2021 at 7:38 pm #1333287Hi Yigit,
Is there a way to change this menu “title” for specific pages? By editing this file it changes the menu title site-wide.
Thanks in advance!December 19, 2021 at 3:55 am #1333401Hi,
You could try this approach, for each page that you want a custom menu title for the Fullwidth Sub Menu on mobile, you will need to know the page ID, so for example when you edit your /backalyckans-forskola/ page the address bar URL is:
/wp-admin/post.php?post=477&action=edit
the post=477 means your page ID is 477
remember that number, now we will add this code to the end of your functions.php file in Appearance ▸ Editor:function custom_menu_title() { ?> <script> (function($) { $(".page-id-477 #sub_menu1 .mobile_menu_toggle .av-current-placeholder").text("Rocket Science"); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_menu_title');
here you will note two parts of the code, the page ID .page-id-477 and the title you want to use Rocket Science
So now that we did one the next one will be easier, we will just add one line of code to the above function, for example we find that the page ID for /backalyckans-policy/ is 1918 and we want the title to read Policy so we write it like this:
$(".page-id-1918 #sub_menu1 .mobile_menu_toggle .av-current-placeholder").text("Policy");
and add it below the other line so the full function now reads this:function custom_menu_title() { ?> <script> (function($) { $(".page-id-477 #sub_menu1 .mobile_menu_toggle .av-current-placeholder").text("Rocket Science"); $(".page-id-1918 #sub_menu1 .mobile_menu_toggle .av-current-placeholder").text("Policy"); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_menu_title');
Best regards,
Mike -
AuthorPosts
- The topic ‘How to change Fullwidth Sub Menu icon text’ is closed to new replies.