• Resolved eldrico

    (@cedricbonnard)


    Hi Guys,

    It’s the first time I use your plugin but I really love it! Very well done! You guys rock!

    By the way I’ve a problem with translating my tagline in enfold theme.
    By default the theme doesn’t show any tagline. The enfold team gave me a php code that show it :
    add_filter('avf_logo_subtext', 'kriesi_logo_addition');
    function kriesi_logo_addition($sub) {
    $sub .= "<strong class='logo-title'>Company Name";
    $sub .= "<strong class='logo-title logo-subtitle'>Additional Text Here";
    return $sub;
    }

    As the theme is made for WPML and as the team doesn’t know your plugin, I want to know if you can help me fix my prob?

    The enfold team gave me a php that would work for WPML:
    if(ICL_LANGUAGE_CODE == ‘code’){

    }
    else {

    }

    I’ve try to replace “ICL_LANGUAGE_CODE” by “pll_the_languages” and ‘code’ by ‘en’ but he doesn’t work. I just have the else action.

    Thanks for your help

    https://wordpress.org/plugins/polylang/

Viewing 2 replies - 1 through 2 (of 2 total)
  • pll_the_languages returns a list of all the languages. You want to use the pll_current_language function:

    switch( pll_current_language() ) :
       case 'es':
        $sub .= '<strong class="logo-title">Title in Spanish</strong>';
        $sub .= '<strong class="logo-subtitle">Headline in Spanish</strong>';
        break;
       case 'fr':
        $sub .= '<strong class="logo-title">Title in French</strong>';
        $sub .= '<strong class="logo-subtitle">Headline in French</strong>';
        break;
      default:
        $sub .= '<strong class="logo-title">Title in default language</strong>';
        $sub .= '<strong class="logo-subtitle">Headline in default language</strong>';
    endswitch;

    Add a case block (4 lines beginning with case and ending with break;) for each additional language.

    Also, consider switching theme in the near future. Hard-coding content in the theme files, as the developers told you to do, is _not_ the right way to code a theme. The developers also sent you a code snippet that contained two errors: incorrect attribute value quotation marks and missing end tag.

    Thread Starter eldrico

    (@cedricbonnard)

    Hi Guys!

    You rock, it works perfectly ;o)

    Thanks for your help and advice about the hard coding.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Polylang and Tagline Enfold Theme’ is closed to new replies.