Theme Support Forum

Support Forum for Free and Premium Themes. Premium Theme Forums are Private! Please log in first to see the Premium forums

If you Like the Asteria Lite Theme and want to Keep it free forever Please Rate it on Wordpress.org (It only takes a few seconds)
Viewing 7 posts - 1 through 7 (of 7 total)

Use POlylang for Menus

Home Forums Free Theme Support Asteria Lite Use POlylang for Menus

  • #112768

    Joris

    Hi !

    Before moving to the Pro version I would like to check a last thing… I am using polylang plugin for translation and it works very well for all the pages. On the other hand I am not able to translate the menus.

    Is this possible?

    BTW, you indicate that the Pro version includes translation, what do you mean ?

    Thanks !

    #113025

    Towfiq I.

    administrator

    1. Please make sure you setup the menu from Appearance> Menus to translate your menu with polylang.

    2. it means the text strings that are used in the theme are translated. e.g: share this, search etc..

    #113156

    joris

    What you mentionned is already OK. The issues I have are the following:

    1. Side Menu Translation (the one in appearance menu)
    2. Tiles for the sliders
    3. The 4 blocks on the frontpage

    Thanks

    #113333

    Towfiq I.

    administrator

    you can do all that if the polylang plugin have any shortcode. does it?

    #113413

    Joris

    Hi,

    I have purchased the theme anyway 🙂 Thanks for your word BTW.

    Point #1 is OK as I specified a different menu. For point # 2 and #3 I’ll check if polylang offers shortcodes or not

    #122500

    Joris

    Hi,

    Seems polylang does not uses shortcodes but string translation. Any idea on how to solve it then ?

    Thanks

    #122857

    Towfiq I.

    administrator

    yes a wrordpress user wrote a custom shortcode function. Add this to your functions.php

    // [polylang lang="en"]English[/polylang][polylang lang="sp"]Spanish[/polylang]
    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');

    before this line:

    //Asteria Site title

    then you can use the shortcode like this:

    [polylang lang="en"]English[/polylang][polylang lang="sp"]Spanish[/polylang]

    source: https://wordpress.org/support/topic/polylang-shortcode-like-qtranslate-for-theme-options-and-text?replies=17

You must be logged in to reply to this topic.