Support » Plugin: Bogo » Link to translation of page

  • Resolved leonhooijer

    (@leonhooijer)


    Hello Takayuki Miyoshi,

    Is it possible to add an url to a page that redirects to a translation of that page?

    For example:
    At the English page with URL “/about-us/” I want to place a link to the Dutch translation that has the URL “/nl/over-ons/”.

    Note that the page name URL is also different so only adding “/nl/” to the URL won’t do.

    Thanks in advance!

    Kind regards,
    Leon Hooijer

    http://wordpress.org/plugins/bogo/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Add this code into your theme’s single page template:

    if ( function_exists( 'bogo_get_post_translations' ) ) {
    	$translations = bogo_get_post_translations();
    
    	if ( ! empty( $translations['nl'] ) )
    		echo get_permalink( $translations['nl'] );
    }
    Thread Starter leonhooijer

    (@leonhooijer)

    I had to change ‘nl’ to ‘nl_NL’, but the rest of the code works perfectly!

    Thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Link to translation of page’ is closed to new replies.