One option would be to create a custom page template. Within that template, you can check for POSTed variables. Something to the effect of:
<?php
/*
* Template Name: Login form
*/
if(!empty($_POST['username'])) {
// check credentials and if valid display data
} else {
// display login form
}
Once you’ve created this file and uploaded it in your theme files (preferably a child theme, if you are not using a custom-built theme; save it as something like tpl-login.php
for easy reference) you can create a Page in WordPress and there will be a dropdown to select the template. Select this “Login form” template, publish the page or save a draft, and you can continue editing your page template until it performs all the functions you need.
Related Posts:
- Add value to usermeta without removing previous values?
- Using Echo in ShortCode – Stuck
- Insert post without actions/hooks
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- PHP code inside shortcodes
- Remove one value in dismissed_wp_pointers?
- Accessing data from a non-WP database/table within a page content
- How to check if a meta value has already been assigned to any user?
- How to display data from custom table in wordpress phpmyadmin
- Calculating a large number of MYSQL queries as customshort codes, slow
- Weird 404 URL Problem – domain name being placed at end of urls
- Modify custom field input data before creating a new post
- Using $wpdb (WPDB class) ‘replace’ with multiple WHERE criteria problem
- Replace shortcode in substring
- Change order of custom submenu link in WP Admin?
- $wpdb returns duplicate posts
- Basic wpdb update question
- Action Hook Inside WordPress Plugin Shortcode
- PHP Helper Class to create shortcodes
- MySQL Query Returns Array () In Shortcode
- Conditional formatting on data fetched from MYSQL
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- I want to hide “sold by” on certain pages with id page 43
- Using the same shortcode to show any table from the database
- WP Custom tables query
- Display total count of products in orders of a specific order status
- Return HTML Template Page with PHP Function
- How to set custom cookies before output
- ob_get_clean returns empty string, ob_get_flush outputs string
- WordPress Customizer: How can you have multiple active callbacks on one control?
- Edit postmeta when user changes user role?
- How to add default images into theme customizer image control?
- How do I hardcode a WordPress shortcode into my theme?
- Successful or Error Message after running mysql code in functions.php
- How to return multiples lines in a shortcode?
- Add attribute / custom attribute to product in woocommerce
- How to create another version of my site based on the same database
- Looking for most performant way to execute several similar WP queries within shortcodes
- Stumped on migration
- Displaying theme options in css
- Hide wordpress field if data is empty in post!
- Show MySQL errors that occur when I excute $wpdb->insert()
- Adding Default Settings to Theme My Login plugin
- WordPress Site Running Extremely Slow on Dedicated Server
- WordPress not reflecting changed of the database
- How can I fix WordPress installation errors?
- Customize Theme comment template to Insert VoteUp and VoteDown buttons
- filter default query to show just selected level of child pages in wordpress
- Set meta field to publish date + 2 weeks
- Adding widgets to my plugin page instead of WordPress dashboard
- Refresh table data with Ajax
- Menu jumping when calling it via PHP
- Remove echo from shortcode
- Large Woocommerce Site (83,000 items), What Can I Do? [closed]
- Help with a $wpdb MySQL Query
- Shortcode to show the code
- How i can obtain all the post meta for a specific post as an array?
- Should `wp_login` be used since it’s deprecated?
- Multiple do_shortcode in page template
- Creating Database Table vs. Adding MetaData to Post & User
- How to put a form with php code into a variable or shortcode?
- WordPress redirect redirecting too many times or not at all
- How to create a field in customize and show that in header.php?
- Handling PHP/HTML inside the output of a shortcode function
- Display attribute on shop page after the title
- Need to Modify a WordPress Shortcode with another wordpress shortcode
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- WordPress WP_Query without query GET parameters
- WPDB secure custom form
- is_user_logged_in returning nothing on custom page
- Customize field names in backend profile edit page through function.php [duplicate]
- Query the links Database
- Why wp_remote_get() fetches certain web pages while it doesn’t work for my localhost?
- How to exclude labels from certain categories in a shortcode?
- Change permalink structure specific category
- Trying to call dynamic content into a 3rd party shortcode
- How to add a shortcode which runs a .php file for the current post
- Block error message in foreach loop when looping through ACF field
- Get title of page containing post grid within the posts
- PHP multiple forms, same page, isset($_POST[]) not working?
- shortcodes, custom php and their errors
- Add a new view on the Woocommerce account page
- How to import woocommerce custom fields data into another site?
- Why my Ajax events are no longer detected after dynamic change of shortcode content
- How to separate the taxonomies list from the form so that editing taxonmies is the same as pages and posts?
- Get posts by id using shortcode
- Remove node from multisites?
- custom field – changing an element or background of id div – different versions not working
- How to detect if a revision was made by woocommerce or wordpress?
- Shortcode in a $output statement
- Need help with PHP functions
- WordPress WPDB::insert 13th param is always blank (only if format)
- Ajax not updating to database
- When using shortcode, content stops generating after the_content
- MySQL query in WordPress with AJAX
- How can I show only if custom field has content [closed]
- Highlight posts currently being edited on multiple editor site?
- WordPress Plugin Receive a Link
- Shortcode to include PHP file, pass various parameters to include?
- Submit cf7 form to cfdb as pdf/BLOB [closed]