Viewing 15 replies - 16 through 30 (of 33 total)
  • Hello,

    How can I change the logo of the site from English to Arabic (logo-en.png) to (logo-ar.png) when switching languages?

    Many thanks
    Hatem

    Plugin Contributor Alex Gor

    (@alexgff)

    @hatem Shaheen

    if ( class_exists( 'WPGlobus' ) ) {
      if ( WPGlobus::Config()->language == 'en' ) {
        echo '<img src="logo-en.png" />';
      } else {
        echo '<img src="logo-ar.png" />';
      }
    }

    Hello Alex,

    many thanks for the quick reply,

    Should I place this code in the header.php file of the current theme?

    and should I replace it with another code or just add it?

    Sorry, I’m not php expert…

    Plugin Contributor Alex Gor

    (@alexgff)

    > Should I place this code in the header.php file of the current theme?
    yes

    > and should I replace it with another code or just add it?
    if you need language selector then just add

    Hi Alex,

    I am also trying to change the logo for different languages on my site. I understand what this code does, but I don’t understand how to use it in my particular case

    if ( class_exists( 'WPGlobus' ) ) {
      if ( WPGlobus::Config()->language == 'en' ) {
        echo '<img src="logo-en.png" />';
      } else {
        echo '<img src="logo-ar.png" />';
      }
    }

    this is the header code I’m trying to work with, from header.php

    <div class='site-logo'>
    					<a href='<?php echo esc_url( home_url( '/' ) ); ?>' title='<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>' rel='home'><img src='<?php echo esc_url( get_theme_mod( 'logo', false ) ); ?>' alt='<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>'></a>
    				</div>

    I know the code is looking to the database for the image src.. is it somehow possible to add the language to it? I’m only using French and English.

    the site in question is here

    https://www.pspkingston.com/advantage

    help would be greatly appreciated.

    BiL

    Plugin Contributor Alex Gor

    (@alexgff)

    What theme are you using ?

    Hi Alex,

    It’s based on a theme called Directory Starter. I have a child theme active.

    https://wpgeodirectory.com/downloads/directory-starter/

    thanks again for the help.

    BiL

    While I’m at it, I might as well ask about how to enable translations on the other little bits of text on the site, such as ‘previous’ ‘next’.. ‘view all’.. all those elements of the site that aren’t a post, category etc..

    thanks again.

    Plugin Contributor Alex Gor

    (@alexgff)

    Excellent, thank you.

    Hi Dears,
    I have been able to place the language selector in the header in the same div as the search button but there is still a problem, it displays “or example” before the language button. Can you please tell me how to remove this annoying text?
    You can see it on this picture: https://image.noelshack.com/fichiers/2016/38/1474489258-or-example.png
    Thanks in advance !

    Plugin Contributor Alex Gor

    (@alexgff)

    @luciano 1
    Could you please give site URL ?

    Plugin Contributor Alex Gor

    (@alexgff)

    Text “or example” does not relate with language selector.
    You can check it yourself in console of browser.
    To fix it you must find needed piece of code in active theme.

    How can I display the 2 letter language abbreviation rather than the full name?

    Some variation of this I’m guessing:

    WPGlobus::Config()->en_language_name[ $lang ]

Viewing 15 replies - 16 through 30 (of 33 total)
  • The topic ‘how to make only one flag’ is closed to new replies.