Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Landing page with login

Try this: Paste it on functions.php (not tested)

add_action('template_redirect', 'my_user_redirect');

function my_user_redirect(){
  if(!is_user_logged_in()){ // only redirect use not logged in
    wp_redirect( home_url( 'welcome' ), 301 );
    exit;
  }
}

Let me know if it worked.

Related Posts:

  1. Redirect loop when trying to login to /wp-admin/ [duplicate]
  2. Show newly added posts since last user login time /date
  3. Can’t access login screen, wp-login.php 404’s
  4. Unable to login + Redirect loop on mobile
  5. How to fix pagination for custom loops?
  6. Jquery Slider for profile template
  7. Counting the posts of a custom WordPress loop (WP_Query)?
  8. if ( is_home() && ! is_front_page() )
  9. Get excerpt using get_the_excerpt outside a loop
  10. How to display Yoast SEO meta description in archive template for each post instead of the_excerpt()? [closed]
  11. Get post content from outside the loop
  12. Why should I put if(have_posts()), is while(have_posts()) not enough?
  13. Display featured products through custom loop in woocommerce on template page
  14. Split Content and Gallery
  15. How to get Author ID outside the loop
  16. How can i display the content in plaintext
  17. How to split a loop into multiple columns
  18. Is it necessary to reset the query after using get_posts()?
  19. Is there any difference between the_title() and echo get_the_title()?
  20. AJAX with loop filtering categories
  21. Do I need to use The Loop on pages?
  22. Remove the Homepage Query
  23. remove tags from the_content
  24. the_title() shows title of the first post instead of the page title?
  25. How to force excerpts / teasers in the loop
  26. Retrieve each widget separately from a sidebar
  27. Why am I being limited to ten posts on a custom loop?
  28. Should I use loop in the single.php file?
  29. A search for ‘0’ returns results
  30. Why do themes rely on “The Loop”?
  31. How to return loop contents
  32. Using the Loop to show all levels of subpages under a parent page? Halfway there
  33. Cleanest Way to Select Every Second Element in a Loop?
  34. Insert image or ad script after 3 posts using the loop
  35. Get date of last update outside of loop
  36. Pagination not working on home page
  37. Child Pages Loop
  38. How to place comments_template(); outside the loop?
  39. Multiple Loops Homepage?
  40. How to Change Loop to Order Posts by Views (using wp-postviews plugin)
  41. how to upload image using wp_handle_upload
  42. Avoiding using a loop to access a single post
  43. How to get the first image gallery of a product in woocommerce in a loop
  44. Get post by page name or slug
  45. save_post + insert_post = infinite loop
  46. Loop.php vs looping inside template file
  47. Get ID of a page containing secondary loop in content
  48. Custom Loop and Infinite Scroll
  49. Loop that displays PARENT PAGE & CHILD PAGE & outputs GRANDCHILD PAGE title and content
  50. is_home, and is_front_page conditional problem
  51. Is `query_posts` really slower than secondary query?
  52. Are there any scenarios where the query_posts may be used?
  53. the_content and wp_link_pages
  54. Adding ‘current_post_item’ class to current post in the loop
  55. How do I get the attributes of a short code from a post?
  56. How can I custom order the results from wp_list_categories?
  57. ACF Repeater loops and resets – where is the reset_rows() documentation? [closed]
  58. WooCommerce Product Page Loop – Output All Product Thumbnails
  59. wp-admin redirecting to https, denying login
  60. Endless loop with wp_insert_post and wp_update_post
  61. Display subpages under parent page as a list within a loop
  62. Why is it necessary to call rewind_posts() when using the loop more than once? [duplicate]
  63. When to use wp_reset_postdata();
  64. Is including the loop necessary for page.php? [duplicate]
  65. the_title(); works in a page template, outside the loop. Why?
  66. wordpress loop for specific category
  67. Add 20yrs to post date, and then query
  68. Why do themes have `while( have_posts() )` in templates like single.php?
  69. When and Why is is_singular(‘my_cpt’) true while in_the_loop() is false?
  70. Three different post types on homepage
  71. What is best way passing variables to theme templates and using them different places like widgets?
  72. Apply styling only to first page sticky posts
  73. WordPress category & taxonomy loop with pagination
  74. Add Incrementing ID to each paragraph in the_content
  75. Changing behavior of the loop twice in one page
  76. How do I prevent one of two multiple loops from repeating on a second page?
  77. Insert/sticky specific post into Loop at specific location
  78. Style every four posts differently [duplicate]
  79. Return vs Echo Shortcode
  80. wp_list_categories: get latest featured_image of category
  81. Hook into the loop via a plugin, and output something after every X post?
  82. Multiple posts with one loop iteration
  83. Two custom loops, pagination, offset
  84. Identify the page being shown while in The Loop
  85. WordPress Alphabetical Glossary close div in loop
  86. Query date in wordpress loop
  87. How to find meta_values to call
  88. Alternate loop output every three posts (within the same original loop)
  89. Show scheduled posts in archive page
  90. Use the_content outside the loop
  91. What exactly defines a Main Loop and a Secondary Loop?
  92. Loop code is displaying pages but not actual posts
  93. Transient not working for custom loops
  94. Where should I use post_class()?
  95. How are both HTTP and HTTPS versions displaying?
  96. Custom Loop, Match Category with Page
  97. Display all authors and their only one latest post
  98. Remove comma from last item output from loop
  99. have_posts() return false but count says “3”
  100. Exclude category by slug for for each loop
Categories loop Tags login, loop
How to create import option for xml
Divide loop into several columns based on post custom field and enable infinite scrolling

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress