something like:
if (
!in_array($GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php'))
&& !is_admin()
&& !is_user_logged_in()
) {
wp_redirect('http://www.mysite.com/landingpage', 301);
exit;
}
should do it.
see http://codex.wordpress.org/Function_Reference/is_admin &
Check if wp-login is current page
Related Posts:
- the_date() not working
- What is the best php version to use with WordPress?
- WP-API v2 Custom Endpoint Response Formatting
- How to call a function only once (global variable scope)
- Multiple is_page() in page.php
- Get author full name
- Where should I install a PHP library into WordPress so that code in a webpage can activate it?
- How to make WordPress plugin check for database changes and then do something?
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- Extract the first oembed url inserted on the content of a post
- Best way of adding CSS which can be manipulated by the user via theme option panels?
- Error in WP_update_post
- How to block specific keywords from searching on WordPress?
- How to check if comments are paginated?
- Use Timber/Twig to pull an image by image ID [closed]
- Is it ok to replace php code with html?
- PHP echo text being output in incorrect order
- Step through wordpress code
- How to download a txt file [closed]
- syntax issue on php 7.4
- Rename “Portfolio” slug?
- Render ninja form inside markup
- Remove a filter added by a plugin
- How to show 50×50 image thumbnail in Related Post
- How to select the contents in the text view textrea in wp_editor?
- Recent Posts slider, using WP_Query(), loads duplicate sliders
- Namespace spl_autoload problem in WordPress admin
- WordPress Theme Options Values
- How to Sort posts by Vote Count?
- Getting error when trying to implement site-wide breadcrumbs in Twentytwentyone Theme [closed]
- How to save checkbox values for logged in users?
- How to store data from multiple forms using ajax and php
- How to control WordPress image metadata (using Imagick)?
- Modifier l’affichage du prix sur la fiche produit
- How can I get a single php file that is the equivalent of an existing WordPress page?
- Ajax date_query not working past the first iteration
- get_terms pagination
- How to use thumbnail size of image if I’m only using src to get image
- Use URL Rewrite as well as $_GET parameters in URL?
- Output custom field value to post string
- showing 2 prices wholesale and normal
- wordpress wp_enqueue_script() not working
- How to sent a email outside WordPress?
- Update post title from external file?
- WordPress plug-in for dynamic download link?
- Override user-edit.php to design own profile page
- How can I add a new row in a separate database when someone registers via WordPress?
- Design with Elementor and code the rest?
- Add 23 hours 59 minutes and 59 seconds to meta key before saving?
- proc_open() fires twice
- How can I get all values from my array in a loop in php? [closed]
- Creating custom page template from existing PHP site
- wordpress site – using custom database and PHP
- cURL error 6 on news area, and also won’t auto update
- Woocommerce custom Plugin in wordpress [closed]
- Implementing custom tag/tax pages
- Change homepage content if user is logged in – BuddyPress
- Custom upload folder
- Replace Post-Title with variable
- WordPress loop is not working
- Displaying Event within two given time frames
- Display movies that apear this day next
- How to edit background color of only one sidebar?
- Edit and delete permissions pages and posts
- Redux option doensn’t seem when include from functions.php
- Set all WooCommerce Products to Simple, Virtual & Downloadable
- Removing links from Grouped products
- Add custom field on admin dashboard comments / reviews
- How to add JS script in specific pages in WordPress?
- Display one random image from Media Library
- How do I programmatically add ‘reviews_allowed’ to WooCommerce product?
- Why is values of a global variable returning blank when inserted into database
- Problem with my Login Plugin
- Suddenly got alert when trying to login to admin panel of wordpress
- How to return html as a string from php for WordPress
- Show Gutenberg facebook embed with a custom theme
- Add code to the header of posts by particular author
- Running a PHP SQL script on a wordpress page
- Taxonomy Child Term, Counter is staying on 0
- LinkedIn Share Post Button
- wordpress more than one ajax request at the same time issue
- load a wordpress page into another wordpress page using iframe
- PHP drop down menu for my get_category child of
- How to display recently modified posts on recent post widget in wordpress
- Explode Content within specific HTML element
- Using get_theme_mod with checkbox to display content
- PHP Shortcode – 500 error
- Non-array argument in array_merge()-function [closed]
- Add specific content after specific text in every post
- retrieve wordpress post-meta using php not wordpress functions
- Too few arguments for printf() [closed]
- Using existing widget code! [closed]
- Pagenav Not appearing on custom Template
- custom data in url
- Dynamically append custom post type to end of url
- Automatically load WordPress page on server every XX hours
- Parse error: syntax error, unexpected ‘}’ in C:\wamp64\www\Proiect\aplicatie\user_check.php on line 18 [closed]
- Pagination in category.php not functioning
- Wrapping the_content() in Schema articleBody tag? [closed]
- Open WordPress Page from selected option dropdown