Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #70954
    Charlotte Charami
    Participant
    Premium Member

    Hi,

    I could have sworn that I already posted this question here, but I can’t find it back, so I’m asking it again.

    I have polylang installed on my website and use Ashe Pro theme.
    Now, I would like to show a “translated” header depending on the language the reader is viewing. For this I found this tutorial , but I’m not entirely sure which specifics for Ashe Pro theme I should use for the header_img part?

    Thanks in advance.

     

    #70960
    vako
    Keymaster
    Premium Member

    Dear Charlotte,

     

    Thank you for reaching out to us with your question about Polylang and Ashe Pro theme. We would be happy to help you with this issue.

    Regarding the tutorial you found, it appears that the “header_img” part is simply a placeholder for the image that you would like to display in your translated header. To customize this for your Ashe Pro theme, you would need to replace “header_img” with the actual image filename or path that you would like to use.

    Here is an example of how this might look with a specific image:

    if ( function_exists( ‘pll_current_language’ ) ) {

    $lang = pll_current_language();

    if ( $lang == ‘fr’ ) {

    echo ‘French Header‘;

    } else {

    echo ‘English Header‘;

    }

    }

    In the above code, we are checking if the current language is set to ‘fr’ (French), and if so, we are displaying the image located at http://example.com/images/header-fr.jpg. If the current language is not set to ‘fr’, we are displaying the image located at http://example.com/images/header-en.jpg instead.

    We hope that this helps you to customize your translated header. If you have any further questions or concerns, please don’t hesitate to reach out.

     

    Kind Regards

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.