【问题标题】:wordpress redirection loop in woocommerce productswoocommerce产品中的wordpress重定向循环
【发布时间】:2014-05-24 22:38:40
【问题描述】:

您好,在更改主题并重新设计网站以及删除并重新安装 woocommerce 后,我的 wordpress 网站出现问题(我没有更新,因为更新导致 wp-admin 变为空白并重新安装后一切正常除了以下问题。)

商店页面中所有指向产品的链接都指向“/product(in hebrew)/product-name/” 当我在 wp-admin 中访问产品并点击“查看产品”页面时,它会转到“/products(english)/product-name/”

问题是当我从商店前端单击产品时,我收到重定向循环错误。我需要尽快解决这个问题。

不知道如何解决这个问题。

网站:www.tikanti.co.il/חנות/

【问题讨论】:

    标签: wordpress redirect woocommerce


    【解决方案1】:

    我找到了解决方法...

    刚刚去了 设置 > parmalinks > 更改了 woocommerce 的选项之一,它刷新了我选择的所有内容。

    谢天谢地,不要再循环了!!!!!!

    【讨论】:

    • 这是由于 Woocomerce 的翻译功能造成的错误
    【解决方案2】:

    要解决此问题,您需要登录 cpanel 并将 .htaccess 权限更改为 777755 然后去 wp-admin 页面然后 setting > parmalinks >
    然后将常用设置更改为帖子名称 这将解决问题

    【讨论】:

      【解决方案3】:

      您可以根据用户角色设置重定向。

       //Redirect users to custom URL based on their role after login
      
      function wp_woo_custom_redirect( $redirect, $user ) {
      
      // Get the first of all the roles assigned to the user
      $role = $user->roles[0];
      $dashboard = admin_url();
      $myaccount = get_permalink( wc_get_page_id( 'my-account' ) );
      
      if( $role == 'administrator' ) {
      
          //Redirect administrators to the dashboard
          $admin_redirect = get_option('admin_redirect');
          $redirect = $admin_redirect;
      } elseif ( $role == 'shop-manager' ) {
      
          //Redirect shop managers to the dashboard
          $shop_manager_redirect = get_option('shop_manager_redirect');
          $redirect = $shop_manager_redirect;
      } elseif ( $role == 'customer' || $role == 'subscriber' ) {
      
          //Redirect customers and subscribers to the "My Account" page
          $customer_redirect = get_option('customer_redirect');
          $redirect = $customer_redirect;
      } else {
      
          //Redirect any other role to the previous visited page or, if not available, to the home
          $redirect = wp_get_referer() ? wp_get_referer() : home_url();
      }
      return $redirect;
      }
      add_filter( 'woocommerce_login_redirect', 'wp_woo_custom_redirect', 10, 2 );
      

      鉴于上述重定向的代码,我为入门级用户或技术人员或非程序员开发了WooCommerce Login or Register Redirect plugin

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2018-12-10
        • 1970-01-01
        • 1970-01-01
        • 2016-11-29
        • 1970-01-01
        • 2018-05-18
        • 2021-07-01
        相关资源
        最近更新 更多