Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #200165

    intellibeam
    Participant

    I have a Google Translate Widget I would like to appear on our static left menu bar. I’m using Icon full width with 1 page navigation that I changed the function.php file from a prior thread: https://theme.co/x/member/forums/topic/icon-demo-with-1-page-navigation/

    I can’t seem to add a widget to that left menu now, I’m guessing since that menu bar isn’t supposed to be there. How could I add a widget that appears above the “Home” button? The code for the widget is [prisna-google-website-translator] My site is lexingtonhousing.org

    Thank you.

    #200491

    Paul R
    Moderator

    Hi,

    Thanks for writing in!

    You can add the code below in your child theme’s functins.php file.

    
    add_filter('wp_nav_menu_items','add_search_box_to_menu', 10, 2);
    function add_search_box_to_menu( $items, $args ) {
        if( $args->theme_location == 'primary' )
            
        return 'Google widget code'.$items;
    }
    

    Change Google widget code with your code.

    Hope that helps.

    #200557

    intellibeam
    Participant

    I tried that but all I get is [prisna-google-website-translator] written on the page not the widget.

    I tried a few ways:

    return ‘[prisna-google-website-translator]’.$items;
    return ‘prisna-google-website-translator’.$items;
    return ‘Prisna GWT’.$items;

    All I get is writing with no widget. Here’s the specs on the widget:

    Usage
    – Go to the Appereance > Widgets panel, search for the following widget

    Prisna GWT

    – Copy and paste the following code into pages, posts, etc…

    [prisna-google-website-translator]

    – Copy and paste the following code into any PHP file

    <?php echo do_shortcode(‘[prisna-google-website-translator]’); ?>

    #200883

    Rad
    Moderator

    Hi there,

    Could you try this?

    return do_shortcode('[prisna-google-website-translator]').$items;

    Please also check if the plugin or feature related to that shortcode is active.

    Thanks!

    #201147

    intellibeam
    Participant

    That worked!

    Is there a way to add padding to the left of the widget area? I need it moved off the left edge a little bit.

    #201454

    Christian
    Moderator

    Hey there,

    Please give us the URL of the page so we could give you a tailored solution.

    Thanks.

    #201603

    intellibeam
    Participant

    Lexingtonhousing.org

    #201796

    Nico
    Moderator

    Hi there,

    Add this to your Customizer’s custom CSS:

    .prisna-gwt-align-left{
    width:65%;
    }

    hope it helps
    thanks.

    #201839

    intellibeam
    Participant

    I added it but it still looks the exact same.

    #202126

    Christopher
    Moderator

    Hi there,

    Please try this instead :

    .prisna-gwt-align-left {
    width: 65%;
    margin: 0 auto;
    display: block;
    }

    Thanks.

    #202317

    intellibeam
    Participant

    That worked flawlessly. Thank you for the help as always!

    #202545

    Nico
    Moderator

    Hi,

    Nice! we are glad to know it helped.

    Enjoy! Thanks! 🙂