Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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?

    #1325460

    Hey,

    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,
    Yigit

    #1333287

    Hi 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!

    #1333401

    Hi,
    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
    2021-12-18_004.jpg
    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');

    2021-12-18_005.jpg
    I hope this makes sense

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘How to change Fullwidth Sub Menu icon text’ is closed to new replies.