You can do this by using
1) is_shop fx
2) template_redirect action hook
3) wp_safe_redirect fx
add_action('template_redirect','ravs_shop_for_login_user');
function ravs_shop_for_login_user(){
//check user in shop page and not login
if( is_shop() && ! is_user_logged_in() )
wp_safe_redirect( home_url() );// enter your url here where you want to redirect page if user on shop page and not registered
}
Note paste this code in functions.php.currently visiter redirect to home page if not registered,provide any url in wp_safe_redirect fx where you want to user redirect.
Related Posts:
- Adding a Taxonomy Filter to Admin List for a Custom Post Type?
- How to tell if a plugin is multisite compatible?
- Get plugin directory from a theme
- Recommended eCommerce Plugin for a T-Shirt Sales Business? [closed]
- GPL and plugins
- Redirection Plugin: Redirect all URLs with a regular expression
- How to un-attach rich text editor from named textarea elements
- WordPress media upload limit?
- Post source link plugin – small modification
- How to add users roles dropdown in registration in wordpress
- Send Data to WordPress from kiosk
- how to not show plugin in admin area
- Getting User email on logout. wp_logout
- delay function on publish?
- Can a plugin add to header/footer/body content?
- Login with email (WP Modal Login)
- How to set CORS header?
- How do I remove the entire left nav bar in admin for certain level users?
- Getting a 404 when trying to load /wp-admin/plugin-install.php
- custom_list_table edit/delete bulk actions
- Why plugin ajax response is -1?
- How to integrate blog status?
- What plugin will allow me to redirect 404 errors to a specific page?
- Changed permalink structure. Need help with redirecting old posts
- Change permalink structure hidden button edit
- How to load plugin after page is loaded – pagespeed issues
- Plugin “WP Attachments” outputs after the_content, how can I best change the location?
- One of my plugins broke when I tried to update it, how do I safely uninstall it?
- How to Add custom subtitle as og:title to Facebook Open Graph Meta Data in WordPress Themes?
- WooCommerce Checkout Error [closed]
- How can I change a plugin’s URL?
- LinkedIn Social Wall | Is there a plug-in (Free / Paid) to display a LinkedIn feed in a social wall (not just a feed)?
- jquery not calling php function
- Custom Fields with Pods not being translated
- page loading time of a cached page
- update_user_meta() misfires sometimes
- Migrating to WordPress Recipe Plugin and Some SQL Issues
- add tabs in rdp-plugin/includes/settings.php and get settings saved
- Multiple domains issue
- WordPress JS- Visual Composer
- WordPress plugin creating database in localhost but not on real host
- ACF only showing up in Homepage but doesn’t appears in all pages
- One file for all translations
- Send admin an email when a user’s search has no results
- How to Loop Through all Posts and Count Attachments using Get Media Attachments
- custom post type don’t appear in the home page
- Shortcode not working after move wordpress website files
- Contact Form 7 – Form name blank [closed]
- plugin dev – minimum base css specificity?
- Help with comments.php
- OceanWP settings are missing from Add New Post [closed]
- Creating a functionality plugin to edit seriously simple podcasting
- in source code but I can’t find it in files or plugins
- Historical customisations won’t go away [closed]
- Loop returns the current page’s permalink and guid instead of the post in the loop
- display connected User to post
- Plugin upgrade failing during unzip
- How to add credit card validation check to wordpress [closed]
- Get access to WordPress when logged out
- How do you add a settings page to another menu?
- What plugin should I use to add Microformats to my blog
- Any way to change WP-PostRatings so you can only vote up?
- Plugin or ways to limit number of users logging in the website,
- Replace old theme that understand old css (vcex_icon_box css_animation)
- WP Ajax DB issues
- ACF checkbox return format based on page
- How do I add a medium to the WordPress database with my own plugin?
- Loading a plugin in a post template without using wp_head()
- How to translate wordpress blog to other languages?
- Hide response returned from WordPress REST API call
- Uncaught TypeError: Cannot read property ‘cycle’ of undefined
- WordPress drop domain alias
- Store admin page into variable
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- WP Plugin CSS not being applied to page
- Unable to sync woocommerce variations
- Plugin does not create a custom table upon activation
- Automatic updates of plugins and themes outside of wordpress.org
- Plugin hook breaks new WP 4.0 media library grid view?
- How to get site homepage from plugin?
- Contact Form loaded with Ajax
- Link Forms on WordPress
- How to correct Error: message on website Twitter Feed
- homepage olderposts link showing page not found
- Image rotator plugin
- Vote It Up Plugin – Add ascending numbers to MostVotedAllTime Chart Function
- Choopy Video Playback in a popup using Artiss Youtube Embed [closed]
- How to fix vanilla comments extra iframe space
- Automatically set posts to NoIndex depending on category?
- Custom time field won’t sort regardless of format
- Move specific javascript to the footer
- How to send email when my plugin is activated?
- Plugin installation works only with FTP – how to debug?
- How to create a custom wordpress plugin for a specific functionality?
- Override the plugin class and function
- WP FULL CALENDAR (NO NEXT ARTICLES DISPLAY)? [closed]
- Redux Framework slides field – How Can i add new placeholder Filed? [closed]
- Woocommerce business card flyer design [closed]
- Video autoplay doesn’t work in slider revolutioun plugin
- Remove H1 title in admin post edit screen