WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. leonhooijer
    Member
    Posted 8 months 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

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

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 8 months 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
    Member
    Posted 8 months ago #

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

    Thank you very much!

Reply

You must log in to post.

About this Plugin

About this Topic