[resolved] Link to translation of page (3 posts)

  1. leonhooijer
    Posted 2 years ago #

    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


  2. Takayuki Miyoshi
    Plugin Author

    Posted 2 years ago #

    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'] );
  3. leonhooijer
    Posted 2 years ago #

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

    Thank you very much!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Bogo
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic