You are going to want to insert your code at the top of the page templates for the Woo pages you would like the redirect to affect rather than the functions file. So for example if you want to redirect users when they try to access an individual product page you could put it at the top of the plugins->woocommerce->templates->single-product.php page.
When editing templates though I would recommend making a copy and placing it in your theme directory, so that when Woo updates it will not override any changes you made. So for the example I gave above (applied to my theme). I would copy single-product.php and place it in the themes->agency file and then make the changes to that file, there. Your theme will then always use that file before the one in the Woo template file.
Related Posts:
- User registration followed by automatic login
- WordPress and magic quotes
- Reposition WooCommerce breadcrumb outside of wrapper content
- Adding “Remember Me” in custom login
- WordPress URL Rewrite not working
- Displaying a WooCommerce product via PHP
- WP E-commerce: Showing 3 random products from current category when viewing product
- Woocommerce -How to set product regular price default
- Change the footer text on the login page
- Changing user_nicename
- How to place login logout link on menu that redirects users back to current page?
- How to turn off redirection from ‘domain.com/login’ to ‘domain.com/wp-login.php’
- How to resolve error “Cookies are blocked due to unexpected output.”?
- Woocommerce price including tax with formatting from options
- Constructing a custom login form using ajax
- automated tests as a user?
- Woocommerce Custom CSV export
- Check if user is logged in when clicking certain links on certain pages
- PHP If user is logged in & on home page redirect
- WordPress shows registration link for non logged users
- Creating login session via CURL
- WP_cron won’t trigger my action
- Adding a div at the bottom of a sidebar
- Recovering WP Login Credintials in Code?
- How to run JS, PHP and etc. inside WP post?
- WordPress custom login form using Ajax
- How to: PHP Log Out Link?
- Why is my cookie not unsetting upon logout? [closed]
- User management system similar to wordpress one?
- WordPress plugin/code to hide all things related of a user from the public
- Programmatic Login from 3rd Party site
- How to debug my custom login form looping intermittently
- getting logged in user info (wp-load.php) from parent directory
- Problem with login form
- Large Woocommerce Site (83,000 items), What Can I Do? [closed]
- showing 2 prices wholesale and normal
- How can I hide that I Use WordPress (with W3 Total Cache)
- WooCommerce Tabs [closed]
- Should `wp_login` be used since it’s deprecated?
- How to redirect users based on role and content of redirect_to?
- How to display login form anywhere, when user isn’t logged in, without redirecting?
- How can I open up my administrative panel to everyone?
- How to solve Woocommerce Memory Limit
- Get ‘Headers already sent’ error for the plugin I am creating when I try to login
- Why doesn’t PhotoSmash plugin play well with wp_query?
- How can I add a new row in a separate database when someone registers via WordPress?
- How to allow download url redirection only if user logged in WordPress site?
- One account with multiple logins
- I installed WordPress locally now how do I login?
- If user is logged in not working
- Change homepage content if user is logged in – BuddyPress
- Show login greeting above sub-menu links?
- Woocommerce getting top level category parent and make all sub categories have the same template and menu
- feedburner plugin for WP 3.5
- Display additional page templates and a sidebar on plugin activation
- is_user_logged_in returning nothing on custom page
- How do I attach an invoice PDF to an email in the Dukapress plugin for WordPress?
- Help with accessing wp-admin page and resolving error messages
- Removing “There is no account with that username or email address.” error message in “/wp-login.php?action=lostpassword”
- Plugin or ways to limit number of users logging in the website,
- Can’t log in to WordPress wp-admin after adding code to functions.php
- Custom fields not showing up in the user info (PaidMembershipsPro)
- Check if user had autologin & if so, logout
- Admin Panel 404 Error after login
- Log out without confirmation request (nonce)
- Which membership plugin for a simple sign in? Personal areas for customers
- Call WP Rest-Api to GET /users/me returned NOTHING in console
- Infinite loop when logging out using custom login form
- Get WordPress username to customize url
- Menu not updating for logged in users after redirect
- how to use auth_redirect() redirect visitor to login page if they are not login when they click account and order page?
- Issues adding Recaptcha v3 to WordPress Registration
- Display specific page if user signed in
- Change Login or Logout text based on status
- Redirecting the lost password page request when using a custon login page
- How do I send a POST request with params with WordPress REST API
- wp-login.php?redirect_to=https problem
- Creating a WordPress addon for ContactForm7 submission (.XML file export)
- is_user_logged_in() not working in homepage
- Adding a sidebar to wp-login.php
- What is the best practice for restricting a section to logged in users?
- List users in a dropdown for login
- divide custom field values in div every two values
- WordPress plugin creating sidebar on the theme/page
- White screen after login attempt
- WordPress and magic quotes
- How To Customize Position of »add to cart« of WooCommerce on Product Page [closed]
- WordPress Pages into Sections edit.php PHP hack
- Advice on setting up private site
- WordPress: Create A Widget to Accompany Plugin
- PHP Syntax getting PHP terms
- How to replace wp-admin login page to another location?
- Get Products within Current Product Category
- Check user last login date
- what is %variable% in a wordpress plugin? [closed]
- How do I do so that people can register on my wordpress site?
- wp_login_url always redirects me to wp-admin
- I can’t log into my website , it says “Error: Cookies are blocked due to unexpected output”
- change div text and link for logged in users
- wp-login – unable to redirect user to a custom login url