דלג על ניווט

תגיות: 

נושא זה מכיל 0 תגובות, יש ל 0קולות.

עודכן לאחרונה על ידי ericH-23 לפני 6 ימים, 22 שעות.

בסיוע: Paola Mendiburu.

מחבר פוסטים
נובמבר 18, 2024בְּ- 9:44 am #16413832

ericH-23

Background of the issue:
I am developing a site and using a function code to redirect WooCommerce product links to the shop page. The redirection works in the standard language but not in other languages. This is my code: add_action('template_redirect','custom_shop_page_redirect'); function custom_shop_page_redirect(){ if (class_exists('WooCommerce')){ if(is_product()){ wp_redirect(home_url('/promote/')); exit(); } } return; }

Symptoms:
Redirect to shop page in other languages gives a 404 error.

Questions:
Why does the redirection work in the standard language but not in other languages?
How can I fix the 404 error when redirecting in other languages?