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
- How to change the wp-login.php page title?
- How build a custom login/register form with error handling?
- WordPress URL Rewrite not working
- Displaying a WooCommerce product via PHP
- Remove admin bar for subscribers
- 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 Customize Position of »add to cart« of WooCommerce on Product Page [closed]
- How can I make content disappear when a user logs in?
- WordPress widget in custom theme
- WordPress 4 invalid username special charachters issue
- 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’
- Bulk Image upload and one image for each post?
- How to resolve error “Cookies are blocked due to unexpected output.”?
- Woocommerce price including tax with formatting from options
- Using a nonce in a Custom Login Form
- Constructing a custom login form using ajax
- automated tests as a user?
- Remove username in emails or swap username for email
- Woocommerce Custom CSV export
- WooCommerce – Fixed quantity of a product [closed]
- 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
- Admin username and password
- How to allow download url redirection only if user logged in WordPress site?
- One account with multiple logins
- Lost in trying to create user database system
- Shortcode to log user into current URL
- PHP getting error when trying to access WP-Admin Dashboard
- 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?
- Make separate text boxes for separate WordPress Custom Fields
- 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
- Refresh page after login with litespeed cache
- Redirect after login depending on the URL
- Need help with AJAX login to call php in functions.php to handle redirects based on user cap (role)
- 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
- Check if a user is logged into my WordPress site which is on a different server
- Newbie question. Login/Registration. New PHP page
- 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
- Not logged in when using http
- add bootstrap modal after login in wordpress
- WordPress plugin creating sidebar on the theme/page
- White screen after login attempt
- WordPress and magic quotes
- How to get WordPress Adminmenu items?
- How To Customize Position of »add to cart« of WooCommerce on Product Page [closed]
- Simple tree display of WordPress menu
- WordPress Pages into Sections edit.php PHP hack
- Advice on setting up private site
- WordPress Plugin Receive a Link
- WordPress: Create A Widget to Accompany Plugin
- Redirect users not logged in to the standard login page (and back) from some posts and pages
- How can I list only Subcategories in Woocommerce
- PHP Syntax getting PHP terms
- Masking external links with internal link for member-only
- 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]
- Prevent users from display default wordpress login form
- login redirect based on user role not work as expected
- How to change wp-admin and wp-login urls
- 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
- Redirect to current URL and append specified URL parameter on unsuccessful login through Elementor login form widget
- change Dashboard default page on login
- Can’t programmatically log user in php