This code works fine if I use is_front_page as current page/url, because it gets my homepage and redirects user by role to a specific path, but it doesn’t work if I try to get a specific current url of wp admin dashboard, I tried with get_home_url(path), but it doesn’t work: Thank you in advance. Answer template_redirect hook is for front-side
Tag: redirect
Redirect error in php with isset and GET variable
I am trying to make some redirects to lock the page from having a different get variable from what i have defined. But the problem is that I am getting a redirect error which is The page isn’t redirecting properly. I tried different things but I could not solve this problem. I need your help please. It is to note
PHP Timeout and TOO_MANY_REDIRECTS
here is the situation; I have an import running on php (basically, you can consider it as a big while loop). But, as there is a lot of data (hours of data to import); I can’t do that in one request, otherwise i’m taking the php timeout error after 10 min. in order to avoid that timeout issue, I’ve decided
PHP cookies and redirection
I have a website in two languages: English and French. And I want to redirect people based on their browser languages: if there browser language is French, I redirect people on /fr, else they go to …
Redirect if there are no posts in the category Laravel
I want to redirect users back if they have selected a category that has no posts. I’ve tried something like this, but it doesn’t work: $check = Category::withCount(‘posts’)->first(); if($cheсk->…
Redirect to shop if cart is emptied on cart page in WooCommerce 3+
In WooCommerce I want to redirect from cart to shop page when cart is empty and I am using this code: function cart_empty_redirect_to_shop(){ global $woocommerce; if ( is_page(‘cart’) and !…
How do I redirect the user to the last active page when they login due to session time out using php? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. Improve this question I have built a little software using Vanilla PHP, I have implemented automatic logout for logged in users who have
How to do 301 redirections after WordPress Permalinks change
I changed the Woocommerce permalink structure of my site and I would need some 301 redirections Help. Woocommerce product permalinks were configured according to the structure: And now according to the structure: What lines do I need to add to the .htaccess file to do 301 redirections, please? UPDATE: /shop/%product_cat%/ is a Permalink Structure in WordPress that means example.com/shop/category1/subcategory1/MyProduct and
Trying to redirect in PHP after submitting an email form
I am building my first site using an MVC framework, and the view that the user sees is determined by the $_GET[‘page’] variable. If you would like to see other code I can post it, but as far as I can tell, the code that is having the problem is displayed below. I’m not sure if it makes a difference,
Creating a WordPress URL Redirect
I’m having a little trouble setting up a Wordpress URL redirect. I’ve designed an ECommerce website with WooCommerce and I’d like to add a search bar that allows me to search filter products in the shop. I’ve added the default Wordpress search function and that works fine, however it display all types of content (posts, pages, products, etc.) from across