• Resolved motan

    (@motan)


    Hy i’m using transposh to setup a multilingual site and i want to move my flags from the footer widget area in to the header area and i found a code but dosn\t work

    https://www.ieage.org here the exemple

    the guy that created that site shared the code for moving the flags in the header

    here is the code i try to copy the code in child-theme functions.php but dosn’t work

    it will be displayed in first position (before the slider if any)
    add_action ('__after_header' , 'add_content_after_header', 0);
    
    function add_content_after_header() {
        //checks if we are displaying the home page
        if ( !tc__f( '__is_home' ) )
            return;
        ?>
    
    <?php
    printf('<a href="/" rel="nofollow"></a>');
    printf('<a href="/en/" rel="nofollow"></a>');
    printf('<a href="/es/" rel="nofollow"></a>');
    printf('<a href="/fr/" rel="nofollow"></a>');
    printf('<a href="/it/" rel="nofollow"></a>');
    printf('<a href="/de/" rel="nofollow"></a>');
    printf('<a href="/el/" rel="nofollow"></a>');
    printf('<a href="/tr/" rel="nofollow"></a>');
    printf('<a href="/ru/" rel="nofollow"></a>');
    printf('<a href="/zh/" rel="nofollow"></a>');
    printf('<a href="/ja/" rel="nofollow"></a>');
    printf('<a href="/ko/" rel="nofollow"></a>');
    printf('<a href="/ar/" rel="nofollow"></a>');
    printf('<a href="/he/" rel="nofollow"></a>');
    printf('<a href="/hi/" rel="nofollow"></a>');
    printf('<a href="/ms/" rel="nofollow"></a>');
    printf('<a href="/id/" rel="nofollow"></a>');
    printf('<a href="/af/" rel="nofollow"></a>');
    printf('<a href="/zu/" rel="nofollow"></a>');
    printf('<a href="/sw/" rel="nofollow"></a>');
    printf('by <a href="https://transposh.org/" rel="nofollow"></a>');
    ?>
    
        <?php
    }
Viewing 9 replies - 1 through 9 (of 9 total)
  • rdellconsulting

    (@rdellconsulting)

    Take out line 1 or start that line with //
    // it will be displayed in first position (before the slider if any)

    Thread Starter motan

    (@motan)

    i did that but nothing happends my site ramains the same ….and my child-theme functions.php works because i did alter the credits and works

    by the way its not the first time that a code does not work ….i also tried to put the video slider code snipped and dosn’t work either

    rdellconsulting

    (@rdellconsulting)

    Did you refresh your cache as it looks fine to me. Ctrl/F5 (Win) or Cmd/F5 (Mac)

    Thread Starter motan

    (@motan)

    i did noting happends
    https://www.aiscreative.com/agriturismo/
    here is my site the flags are displayed o footer area one and i want them under the header description like in this example https://www.ieage.org

    i got the code from the theme &co site the owner of that site posted there

    i did copy/paste the code in my functions.php but nothing happends ?? …i’m such a beginner …

    rdellconsulting

    (@rdellconsulting)

    And I’m seeing that here

    Thread Starter motan

    (@motan)

    Just now i did it! whit the adding a new widget under the header ??
    thx alot

    and for others that wants to display there flags under the header just add this code in child-theme functions.php

    you can find more info about this here Themes & CO

    if (function_exists('register_sidebar')) {
     register_sidebar(array(
     'name' => 'Extra Widget After Navbar',
     'id' => 'extra-widget',
     'description' => 'Extra widget after the navbar',
     'before_widget' => '<div class="widget %2$s" id="%1$s">',
     'after_widget' => '</div>',
     'before_title' => '<h2>',
     'after_title' => '</h2>'
     ));
    }
    
    add_filter ('__after_navbar', 'add_my_widget');
    function add_my_widget() {
     if (function_exists('dynamic_sidebar')) {
     dynamic_sidebar('Extra Widget After Navbar');
     }
    }

    by the way if u want to change the position of the widget just change the __after_navbar whit the location u desire more info here https://themesandco.com/customizr/hooks-api/

    rdellconsulting

    (@rdellconsulting)

    Woo

    Please mark as [resolved]

    Thread Starter motan

    (@motan)

    resolved!

    Hello guys, i did the exact procedure above copied both blocks of code in the
    child-theme functions.php file but doesn’t work. what am I doing wrong? I’m sure you can help me resolve this..looks great in your site motan!!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Transposh flags in the header’ is closed to new replies.