Title: Important Issue!
Last modified: August 6, 2018

---

# Important Issue!

 *  Resolved [kocakserdar7](https://wordpress.org/support/users/kocakserdar7/)
 * (@kocakserdar7)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/important-issue-2/)
 * Hi dear,
 * I’m using Multilingual press plugin to connect each site (TR and EN) and I have
   a important issue. My theme developer tried to fix that issue but he couldn’t…
   He said ” it’s mostly related to the plugin. ”.
 * Check the thread for more information please: [https://themeforest.net/item/writing-blog-personal-blog/11547928/comments?page=22&filter=all#comment_20076643](https://themeforest.net/item/writing-blog-personal-blog/11547928/comments?page=22&filter=all#comment_20076643)
 * **Regarding the issue,**
 * 1- I create a category named ” SEO Library ” for each language (url: [https://wplibrary.net/category/seo-library](https://wplibrary.net/category/seo-library))
   
   2- I connect these categories via your plugin for Turkish and English. 1- Then,
   I create a page that is called ”SEO ”. ( url: [https://wplibrary.net/seo](https://wplibrary.net/seo)
   and [https://wplibrary.net/tr/seo](https://wplibrary.net/tr/seo) ) 2- I change
   template of this page as ” Blog page ” and select ”show SEO category posts only
   on this page ” (check the following image please.) 3- Then, connect these pages
   with Multilingual Press plugin for Turkish and English.
 * [⌊Ekran Resmi 2018 08 03 14 34 51⌉⌊Ekran Resmi 2018 08 03 14 34 51⌉[
 * **Result and issue:** Linkage (language switcher) on the footer redirects visitors
   from ” SEO page ” to the **category page** only. But hreflang on the source code
   looks correct.
 * Example:
    go to: [https://wplibrary.net/seo](https://wplibrary.net/seo) and click”
   Türkçe ” on the footer. it will redirect you to the category page: [https://wplibrary.net/category/seo-library](https://wplibrary.net/category/seo-library)
 * But it should be redirected you to the Turkish page. Not category page.
 * As I said before, hreflang looks correct on the SEO page.
    `<link rel="alternate"
   hreflang="en-US" href="https://wplibrary.net/seo/"><link rel="alternate" hreflang
   ="tr-TR" href="https://wplibrary.net/tr/seo/">`
 * Please bro help me!
 * ——
    Additionally information:
 * If I change template of the page as ” Default template ” (Not -Blog page-). The
   linkage on the footer is working correctly.
 * [⌊Ekran_Resmi_2018_08_03_14_57_55⌉⌊Ekran_Resmi_2018_08_03_14_57_55⌉[
 * For instance: [https://wplibrary.net/contact-us](https://wplibrary.net/contact-us)(
   no problem for this page).
 * **I need your help. Could you please fix that issue?**
 * **THANK YOU SO MUCH!
    Best regards!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fimportant-issue-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Support [dinamiko](https://wordpress.org/support/users/dinamiko/)
 * (@dinamiko)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/important-issue-2/#post-10567913)
 * Hi kocakserdar7,
 * We don´t know what this theme template (Blog Page) is doing under the hood, we
   can not check and see the code because it is a premium theme.
 * As a workaround, MultilingualPress (MLP) provides a filter that allows you to
   change the value of the URLs (like menu items or language switcher) based on 
   conditions, for example if the page is SEO you can do a search and replace in
   the URL.
 * Here is a code snippet that you can add to your theme functions.php and use as
   a starting point, you need to adapt it:
 *     ```
       function filter_mlp_linked(
           $url,
           $target_site_id,
           $target_content_id,
           Mlp_Translation_Interface $translation
       ) {
   
           if (!is_page('seo')) {
               return $url;
           }
   
           if (!is_a($translation, 'Mlp_Translation_Interface')) {
               return $url;
           }
   
           $source_site_id = $translation->get_source_site_id();
           if (!$source_site_id) {
               return $url;
           }
   
           if (is_page('seo')) {
               str_replace(
                   '/category/seo-library',
                   '/tr/seo/',
                   $url
               );
           }
   
           return $url;
       }
       add_filter( 'mlp_linked_element_link', 'filter_mlp_linked', 10, 4 );
       ```
   
 * Thanks,
    Emili
 *  Thread Starter [kocakserdar7](https://wordpress.org/support/users/kocakserdar7/)
 * (@kocakserdar7)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/important-issue-2/#post-10568163)
 * Hello Emili,
 * Thank you for your help, I really appreciate it 🙂
 * But the code snippet is not working. How can I adapt it? I added it to **functions.
   php**, and then **purged all** cache.
 * Best regards!
    -  This reply was modified 7 years, 8 months ago by [kocakserdar7](https://wordpress.org/support/users/kocakserdar7/).
    -  This reply was modified 7 years, 8 months ago by [Marius L. J.](https://wordpress.org/support/users/clorith/).
      Reason: Removed login offer
 *  [pentatonicfunk](https://wordpress.org/support/users/pentatonicfunk/)
 * (@pentatonicfunk)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/important-issue-2/#post-10588201)
 * [@kocakserdar7](https://wordpress.org/support/users/kocakserdar7/) try to apply
   the code in `mu-plugin.php`
 *  Thread Starter [kocakserdar7](https://wordpress.org/support/users/kocakserdar7/)
 * (@kocakserdar7)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/important-issue-2/#post-10589477)
 * Hi [@pentatonicfunk](https://wordpress.org/support/users/pentatonicfunk/),
 * There is no mu-plugin.php file but I tried to add this code into multilingual-
   press.php
 * It is not working unfortunately.
 * But thank you for your help!
 *  Plugin Support [dinamiko](https://wordpress.org/support/users/dinamiko/)
 * (@dinamiko)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/important-issue-2/#post-10595304)
 * Hi kocakserdar7,
 * We can only provide fixes for bugs in the plugin that can be reproduced in isolation,
   so if you can provide us with the steps to reproduce the issue using a default
   WordPress theme and with MLP only activated, then we can create an issue and 
   work on the fix.
 * The code snippet we provided you is not a copy/paste solution, you (or you developer)
   can use it as a starting point, but it needs to be adapted based on your template
   logic.
 * Another option you can try is using a Navigation Menu widget with a WordPress
   menu, to do so first create a WordPress menu and add MultilingualPress Language
   items (you need to check Languages in top right Screen options to see the Language
   items), then assign this menu to Navigation Menu widget.
 * Thanks,
    Emili
    -  This reply was modified 7 years, 8 months ago by [dinamiko](https://wordpress.org/support/users/dinamiko/).
    -  This reply was modified 7 years, 8 months ago by [dinamiko](https://wordpress.org/support/users/dinamiko/).
 *  Thread Starter [kocakserdar7](https://wordpress.org/support/users/kocakserdar7/)
 * (@kocakserdar7)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/important-issue-2/#post-10605254)
 * Hi Emili,
 * It is fixed by the theme developer. The issue was related to blog page query.
 * Thank you for your helps 🙂
    Best regards!
    -  This reply was modified 7 years, 7 months ago by [kocakserdar7](https://wordpress.org/support/users/kocakserdar7/).

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Important Issue!’ is closed to new replies.

 * ![](https://ps.w.org/multilingual-press/assets/icon-256x256.png?rev=2188271)
 * [MultilingualPress](https://wordpress.org/plugins/multilingual-press/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/multilingual-press/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/multilingual-press/)
 * [Active Topics](https://wordpress.org/support/plugin/multilingual-press/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/multilingual-press/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/multilingual-press/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [kocakserdar7](https://wordpress.org/support/users/kocakserdar7/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/important-issue-2/#post-10605254)
 * Status: resolved