Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #984835

    hi there,
    is it possible to translate the content of the field named “Phone Number or small info text” in the header by using polylang?

    thanks, martin

    #984867

    if you are activating the shortcodes for polylang via your functions.php of your child-theme:

    
    function polylang_shortcode($atts, $content = null){
    	if (empty($content))
    	return '';
    	extract( shortcode_atts( array('lang' => ''), $atts ) );
    	if (empty($lang))
    	return "<h3>You must specify 'lang' using shortcode: polylang</h3>";
    	return ($lang == pll_current_language()) ? $content : '';
    }
    add_shortcode('polylang', 'polylang_shortcode');

    you then can use this in all text fields – and a lot of enfold options input fields too (like footer copyright field) on this :

    [polylang lang="en"]PhoneNumber for english sites [/polylang][polylang lang="de"]PhoneNumber for german sites[/polylang]

    etc. pp

    #984998

    Hi,

    Thanks for sharing and helping out @guenni007, did you try that out @spql?

    Best regards,
    Rikard

    #985039

    Hi Guenni007 and Rikard, thanks for your answers. This worked fine, thank you!

    #985302

    Hi,

    Glad we could help!

    Please take a moment to review our theme and show your support https://themeforest.net/downloads
    Don’t forget to bookmark Enfold Documentation for future reference.

    Thank you for using Enfold :)

    Best regards,
    Basilis

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘translating header content via polylang’ is closed to new replies.